Mercurial > piecrust2
diff piecrust/admin/views/create.py @ 935:7ecb946bfafd
admin: Lots of fixes for running the admin panel in a WSGI server.
- Use new source APIs in the dashboard to open WIP files.
- Fixed broken/outdated code in some views.
- Fixed cases when Flask is not running at the root URL by using the
`SCRIPT_NAME` variable somewhat more properly.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 04 Oct 2017 09:15:16 -0700 |
parents | 942565723e99 |
children | 18d6ac20a132 |
line wrap: on
line diff
--- a/piecrust/admin/views/create.py Wed Oct 04 09:11:58 2017 -0700 +++ b/piecrust/admin/views/create.py Wed Oct 04 09:15:16 2017 -0700 @@ -4,6 +4,7 @@ from flask.ext.login import login_required from piecrust.page import Page from piecrust.sources.interfaces import IInteractiveSource +from piecrust.uriutil import split_uri from ..blueprint import foodtruck_bp from ..views import with_menu_context @@ -72,5 +73,6 @@ page = Page(source, content_item) uri = page.getUri() logger.debug("Redirecting to: %s" % uri) - return redirect(url_for('.edit_page', uri=uri)) + _, rel_url = split_uri(page.app, uri) + return redirect(url_for('.edit_page', url=rel_url))