diff options
author | Adolfo Fitoria <fitoria@fitoria-laptop.(none)> | 2009-08-09 17:41:57 -0600 |
---|---|---|
committer | Adolfo Fitoria <fitoria@fitoria-laptop.(none)> | 2009-08-09 17:41:57 -0600 |
commit | a084c0a71fd69ac57740eb8411df9499e6458915 (patch) | |
tree | b689e32f3a9d9807b5a20effcef17661d83d6990 /forum | |
parent | 56202f708e0433e6dadf17a1657f1d3cd7cb2879 (diff) | |
download | askbot-a084c0a71fd69ac57740eb8411df9499e6458915.tar.gz askbot-a084c0a71fd69ac57740eb8411df9499e6458915.tar.bz2 askbot-a084c0a71fd69ac57740eb8411df9499e6458915.zip |
fixing more python 2.4 compat issues (hope it will be the last ones)
Diffstat (limited to 'forum')
-rw-r--r-- | forum/auth.py | 5 | ||||
-rw-r--r-- | forum/models.py | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/forum/auth.py b/forum/auth.py index 36ca54d3..776746e8 100644 --- a/forum/auth.py +++ b/forum/auth.py @@ -167,7 +167,10 @@ def can_upload_files(request_user): ########################################### def calculate_reputation(origin, offset): result = int(origin) + int(offset) - return result if result > 0 else 1 + if (result > 0): + return result + else: + return 1 @transaction.commit_on_success def onFlaggedItem(item, post, user): 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() |