diff options
author | Martin Green <martin.speleo@gmail.com> | 2022-07-26 17:09:15 +0100 |
---|---|---|
committer | Martin Green <martin.speleo@gmail.com> | 2022-07-26 17:09:15 +0100 |
commit | 91568b71516c6418bd9e2bd00433486bc6baf769 (patch) | |
tree | ea24424f280299282dfc0ee726bff869809e29c3 /core/views/expo.py | |
parent | 7090bab6323e5ea856c6fc4c6e28967f8891acff (diff) | |
download | troggle-91568b71516c6418bd9e2bd00433486bc6baf769.tar.gz troggle-91568b71516c6418bd9e2bd00433486bc6baf769.tar.bz2 troggle-91568b71516c6418bd9e2bd00433486bc6baf769.zip |
Allow HTML to be blank and determine the new files need git commiting.
Diffstat (limited to 'core/views/expo.py')
-rw-r--r-- | core/views/expo.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/core/views/expo.py b/core/views/expo.py index cf17346..4dca1a1 100644 --- a/core/views/expo.py +++ b/core/views/expo.py @@ -356,7 +356,7 @@ def editexpopage(request, path): body = body.replace("\r", "") result = "%s<head%s>%s</head>%s<body%s>\n%s</body>%s" % (preheader, headerargs, head, postheader, bodyargs, body, postbody) - if result != html: # Check if content changed at all + if not filefound or result != html: # Check if content changed at all try: change_message = pageform.cleaned_data["change_message"] write_and_commit([(filepath, result, "utf-8")], f'{change_message} - online edit of {path}') @@ -382,6 +382,5 @@ class ExpoPageForm(forms.Form): ''' title = forms.CharField(widget=forms.TextInput(attrs={'size':'60', 'placeholder': "Enter title (displayed in tab)"})) html = forms.CharField(widget=HTMLarea(attrs={"height":"80%", "rows":20, 'placeholder': "Enter page content (using HTML)"}, - preview = True - )) + preview = True), required=False) change_message = forms.CharField(widget=forms.Textarea(attrs={"cols":80, "rows":3, 'placeholder': "Describe the change made (for version control records)"})) |