Browse Source

#838: some fields return None for empty data instead of empty string

Rafał Pitoń 8 years ago
parent
commit
a2a3c296a2
1 changed files with 4 additions and 4 deletions
  1. 4 4
      misago/threads/forms.py

+ 4 - 4
misago/threads/forms.py

@@ -92,11 +92,11 @@ class AttachmentTypeForm(forms.ModelForm):
         return data
 
     def clean_mimetypes(self):
-        return self.clean_list(self.cleaned_data['mimetypes'])
-
-    def clean_list(self, value):
-        if not value:
+        data = self.cleaned_data['mimetypes']
+        if not data:
             return None
+        return self.clean_list(data)
 
+    def clean_list(self, value):
         items = [v.lstrip('.') for v in value.lower().replace(' ', '').split(',')]
         return ','.join(set(filter(bool, items)))