# HG changeset patch # User Ludovic Chabant # Date 1519014676 28800 # Node ID a1c6050c980150b0215c8223c9eb138316c0e067 # Parent c714bcdc8b3bf9aa9fd0512fe0df86bc5b091448 admin: Fix possible crash in the edit page. diff -r c714bcdc8b3b -r a1c6050c9801 piecrust/admin/views/edit.py --- 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)