Skip to content
This repository has been archived by the owner on Jun 18, 2020. It is now read-only.

Commit

Permalink
Merge pull request #458 from ivoks/url_publishing
Browse files Browse the repository at this point in the history
Use existing url_for_worksheet() for redirects
  • Loading branch information
dimpase authored Oct 17, 2018
2 parents bb327b8 + d764a6f commit efa7d8d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sagenb/flask_version/worksheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -869,23 +869,23 @@ def worksheet_publish(worksheet):
if 'yes' in request.values and 'auto' in request.values:
g.notebook.publish_worksheet(worksheet, g.username)
worksheet.set_auto_publish(True)
return redirect(worksheet_publish.url_for(worksheet))
return redirect(url_for_worksheet(worksheet))
# Just publishes worksheet
elif 'yes' in request.values:
g.notebook.publish_worksheet(worksheet, g.username)
return redirect(worksheet_publish.url_for(worksheet))
return redirect(url_for_worksheet(worksheet))
# Stops publication of worksheet
elif 'stop' in request.values:
g.notebook.delete_worksheet(worksheet.published_version().filename())
return redirect(worksheet_publish.url_for(worksheet))
return redirect(url_for_worksheet(worksheet))
# Re-publishes worksheet
elif 're' in request.values:
g.notebook.publish_worksheet(worksheet, g.username)
return redirect(worksheet_publish.url_for(worksheet))
return redirect(url_for_worksheet(worksheet))
# Sets worksheet to be published automatically when saved
elif 'auto' in request.values:
worksheet.set_auto_publish(not worksheet.is_auto_publish())
return redirect(worksheet_publish.url_for(worksheet))
return redirect(url_for_worksheet(worksheet))
# Returns boolean of "Is this worksheet set to be published automatically when saved?"
elif 'is_auto' in request.values:
return str(worksheet.is_auto_publish())
Expand Down

0 comments on commit efa7d8d

Please sign in to comment.