]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/models/node.py
Resolves Jira OSQA-359, adding an option to allow negative user reputation in the...
[osqa.git] / forum / models / node.py
index bf82708cdf604644ec0c7a2b5e76a71708d0d9bb..286bf4afc564eccf39eedd662fb1dfc89db3472c 100644 (file)
@@ -52,7 +52,7 @@ class NodeContent(models.Model):
 
     def tagname_list(self):
         if self.tagnames:
-            return [name.strip() for name in self.tagnames.split(u' ') if name]
+            return [name.strip() for name in self.tagnames.split() if name]
         else:
             return []
 
@@ -375,6 +375,18 @@ class Node(BaseModel, NodeContent):
 
         return active_users
 
+    def get_last_edited(self):
+        if not self.last_edited:
+            try:
+                le = self.actions.exclude(action_type__in=('voteup', 'votedown', 'flag'), canceled=True).order_by('-action_date')[0]
+                self.last_edited = le
+                self.save()
+            except:
+                pass
+
+        return self.last_edited
+
+
     def _list_changes_in_tags(self):
         dirty = self.get_dirty_fields()