X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/b8f3a2323d03384198863e35d6467a8624a2e31a..ddce82ce7b9c030a00fa700d11094ac4b24b6176:/forum/models/node.py diff --git a/forum/models/node.py b/forum/models/node.py index 7c09189..cf69233 100644 --- a/forum/models/node.py +++ b/forum/models/node.py @@ -1,4 +1,3 @@ -from forum.akismet import * from base import * from tag import Tag @@ -31,12 +30,13 @@ class NodeContent(models.Model): def tagname_list(self): if self.tagnames: - return [name for name in self.tagnames.split(u' ')] + t = [name.strip() for name in self.tagnames.split(u' ') if name] + return [name.strip() for name in self.tagnames.split(u' ') if name] else: return [] def tagname_meta_generator(self): - return u','.join([unicode(tag) for tag in self.tagname_list()]) + return u','.join([tag for tag in self.tagname_list()]) class Meta: abstract = True @@ -255,19 +255,6 @@ class Node(BaseModel, NodeContent): super(Node, self).save(*args, **kwargs) if tags is not None: self.tags = tags - @staticmethod - def isSpam(comment, data): - api = Akismet() - - if not api.key: - return False - else: - if api.comment_check(comment, data): - return True - else: - return False - return data - class Meta: app_label = 'forum'