]> git.openstreetmap.org Git - osqa.git/commitdiff
Allows possible empty sets of question tags.
authorhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Thu, 26 May 2011 19:57:48 +0000 (19:57 +0000)
committerhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Thu, 26 May 2011 19:57:48 +0000 (19:57 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1051 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/models/node.py

index 286bf4afc564eccf39eedd662fb1dfc89db3472c..96b41dcd054af541519873fdb0925562390a6d7b 100644 (file)
@@ -480,7 +480,10 @@ class Node(BaseModel, NodeContent):
         
         super(Node, self).save(*args, **kwargs)
         if tags_changed:
-            self.tags = list(Tag.objects.filter(name__in=self.tagname_list()))
+            if self.tagnames.strip():
+                self.tags = list(Tag.objects.filter(name__in=self.tagname_list()))
+            else:
+                self.tags = []
 
     class Meta:
         app_label = 'forum'