Mercurial > piecrust2
comparison foodtruck/views/edit.py @ 607:c67dcc0fa80f
admin: Prompt the user for a commit message when committing a page.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 27 Jan 2016 22:47:24 -0800 |
parents | 3cec8634209a |
children | efc1dc916e7c |
comparison
equal
deleted
inserted
replaced
606:f1e03f85f14d | 607:c67dcc0fa80f |
---|---|
37 fp.write(page_text) | 37 fp.write(page_text) |
38 flash("%s was saved." % os.path.relpath( | 38 flash("%s was saved." % os.path.relpath( |
39 page.path, site_app.root_dir)) | 39 page.path, site_app.root_dir)) |
40 | 40 |
41 if 'do_save_and_commit' in request.form: | 41 if 'do_save_and_commit' in request.form: |
42 message = "Edit %s" % os.path.relpath( | 42 message = request.form.get('commit_msg') |
43 if not message: | |
44 message = "Edit %s" % os.path.relpath( | |
43 page.path, site_app.root_dir) | 45 page.path, site_app.root_dir) |
44 site.scm.commit([page.path], message) | 46 site.scm.commit([page.path], message) |
45 | 47 |
46 if 'do_preview' in request.form: | 48 if 'do_preview' in request.form: |
47 return _preview_page(page) | 49 return _preview_page(page) |