self.body = self.rendered(revision.body)
self.active_revision = revision
- self.update_last_activity(user)
+
+ # Try getting the previous revision
+ try:
+ prev_revision = NodeRevision.objects.get(node=self, revision=revision.revision-1)
+
+ update_activity = True
+
+ # Do not update the activity if only the tags are changed
+ if prev_revision.title == revision.title and prev_revision.body == revision.body \
+ and prev_revision.tagnames != revision.tagnames and not settings.UPDATE_LATEST_ACTIVITY_ON_TAG_EDIT:
+ update_activity = False
+ except NodeRevision.DoesNotExist:
+ update_activity = True
+ finally:
+ if update_activity:
+ self.update_last_activity(user)
self.save()
label = _("Recent awards block size"),
help_text = _("The number of awards to display in the recent awards block in the front page.")))
+UPDATE_LATEST_ACTIVITY_ON_TAG_EDIT = Setting('UPDATE_LATEST_ACTIVITY_ON_TAG_EDIT', True, VIEW_SET, dict(
+label = _("Update latest activity on tag edit"), required=False,
+help_text = _("If you check this the latest activity will be updated when editing only the tags of a question.")))
+
LIMIT_RELATED_TAGS = Setting('LIMIT_RELATED_TAGS', 0, VIEW_SET, dict(
label = _("Limit related tags block"),
-help_text = _("Limit related tags block size in questions list pages. Set to 0 to display all all tags.")))
\ No newline at end of file
+help_text = _("Limit related tags block size in questions list pages. Set to 0 to display all all tags.")))