From: hernani Date: Thu, 26 May 2011 19:57:48 +0000 (+0000) Subject: Allows possible empty sets of question tags. X-Git-Tag: live~262 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/a3789a5369fa797fb765b3234a4ad796accd28e4 Allows possible empty sets of question tags. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1051 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum/models/node.py b/forum/models/node.py index 286bf4a..96b41dc 100644 --- a/forum/models/node.py +++ b/forum/models/node.py @@ -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'