Mercurial > piecrust2
changeset 1107:a1c6050c9801
admin: Fix possible crash in the edit page.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 18 Feb 2018 20:31:16 -0800 |
parents | c714bcdc8b3b |
children | b2a34a6ec5e5 |
files | piecrust/admin/views/edit.py |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/piecrust/admin/views/edit.py Sun Feb 18 20:30:22 2018 -0800 +++ b/piecrust/admin/views/edit.py Sun Feb 18 20:31:16 2018 -0800 @@ -78,7 +78,8 @@ _, ext = os.path.splitext(filename) filename = request.form['ft-asset-name'] + ext filename = secure_filename(filename) - dirname, _ = os.path.splitext(page.path) + # TODO: this only works for FS sources. + dirname, _ = os.path.splitext(page.content_spec) dirname += '-assets' if not os.path.exists(dirname): os.makedirs(dirname)