-from forum.akismet import *\r
from base import *\r
from tag import Tag\r
\r
def summary(self):\r
return strip_tags(self.html)[:300]\r
\r
+ @models.permalink\r
+ def get_revisions_url(self):\r
+ return ('revisions', (), {'id': self.id})\r
+\r
def update_last_activity(self, user, save=False):\r
self.last_activity_by = user\r
self.last_activity_at = datetime.datetime.now()\r
revision.save()\r
return revision\r
\r
- def create_revision(self, user, action=None, **kwargs):\r
+ def create_revision(self, user, **kwargs):\r
number = self.revisions.aggregate(last=models.Max('revision'))['last'] + 1\r
revision = self._create_revision(user, number, **kwargs)\r
- self.activate_revision(user, revision, action)\r
+ self.activate_revision(user, revision)\r
return revision\r
\r
- def activate_revision(self, user, revision, action=None):\r
+ def activate_revision(self, user, revision):\r
self.title = revision.title\r
self.tagnames = revision.tagnames\r
self.body = revision.body\r
self.active_revision = revision\r
self.update_last_activity(user)\r
\r
- if action:\r
- self.last_edited = action\r
-\r
self.save()\r
\r
def get_tag_list_if_changed(self):\r
\r
@staticmethod\r
def isSpam(comment, data):\r
- api = Akismet()\r
-\r
- if not api.key:\r
- return False\r
- else:\r
- if api.comment_check(comment, data):\r
- return True\r
- else:\r
- return False\r
- return data\r
+ return False\r
+ #if not settings.WORDPRESS_API_KEY:\r
+ # return False\r
+ #\r
+ #api = Akismet(settings.WORDPRESS_API_KEY, settings.APP_URL)\r
+ #return api.comment_check(comment, data)\r
\r
class Meta:\r
app_label = 'forum'\r