1. Curtis Maloney
  2. flat_forum

Commits

funkybob  committed 4ce85c0

Fixed auto-tagging

  • Participants
  • Parent commits 6f3cf0d
  • Branches default

Comments (0)

Files changed (1)

File flat_forum/forms.py

View file
     def clean(self):
         '''Auto-tag'''
         data = self.cleaned_data
-        tags = set([ tag.lower() for tag in data['tags'] ])
+        tags = set([ tag.lower() for tag in data.get('tags', []) ])
         tags.update([
             tag
             for tag in TaggedItem.tags_for(models.Post)
         ])
         data['tags'] = list(tags)
         return data
+
     class Meta:
         model = models.Post
         exclude = ['reply_to', 'posted_by', 'created',]