fix stupid bug on save
authorJan Szejko <janek37@gmail.com>
Thu, 28 Dec 2017 15:21:39 +0000 (16:21 +0100)
committerJan Szejko <janek37@gmail.com>
Thu, 28 Dec 2017 15:21:39 +0000 (16:21 +0100)
apps/wiki/forms.py

index 141f1b6..d526bfc 100644 (file)
@@ -82,7 +82,8 @@ class DocumentTextSaveForm(forms.Form):
 
     def clean_text(self):
         text = self.cleaned_data.get('text', '')
-        return remove_empty_elements(text)
+        # remove_empty_elements returns None on SyntaxError or when there's no change
+        return remove_empty_elements(text) or text
 
     def save(self):
         if self.user.is_authenticated():