summaryrefslogtreecommitdiffstats
path: root/forum/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'forum/models.py')
-rw-r--r--forum/models.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/forum/models.py b/forum/models.py
index 255eb21f..4d8894e4 100644
--- a/forum/models.py
+++ b/forum/models.py
@@ -652,7 +652,10 @@ def record_comment_event(instance, created, **kwargs):
from django.contrib.contenttypes.models import ContentType
question_type = ContentType.objects.get_for_model(Question)
question_type_id = question_type.id
- type = TYPE_ACTIVITY_COMMENT_QUESTION if instance.content_type_id == question_type_id else TYPE_ACTIVITY_COMMENT_ANSWER
+ if (instance.content_type_id == question_type_id):
+ type = TYPE_ACTIVITY_COMMENT_QUESTION
+ else:
+ type = TYPE_ACTIVITY_COMMENT_ANSWER
activity = Activity(user=instance.user, active_at=instance.added_at, content_object=instance, activity_type=type)
activity.save()