summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdolfo Fitoria <fitoria@fitoria-laptop.(none)>2009-08-05 10:01:55 -0600
committerAdolfo Fitoria <fitoria@fitoria-laptop.(none)>2009-08-05 10:01:55 -0600
commit6140720b3a4d2a4c00e425e4c23621b574109c35 (patch)
treeb644c8423903543bc2fb1eaaef8aaf580d8ec192
parentf7eac8b7ea109baed650315fb21998d3f13d6183 (diff)
parenta4c7abc352016e7de676102b130ed0a6becc8f2c (diff)
downloadaskbot-6140720b3a4d2a4c00e425e4c23621b574109c35.tar.gz
askbot-6140720b3a4d2a4c00e425e4c23621b574109c35.tar.bz2
askbot-6140720b3a4d2a4c00e425e4c23621b574109c35.zip
Merge branches 'master' and 'experimental'
-rw-r--r--forum/auth.py5
-rw-r--r--forum/models.py12
-rw-r--r--forum/views.py10
3 files changed, 22 insertions, 5 deletions
diff --git a/forum/auth.py b/forum/auth.py
index 0608031a..082f5186 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 ad93f9f0..597fe6db 100644
--- a/forum/models.py
+++ b/forum/models.py
@@ -173,7 +173,10 @@ class Question(models.Model):
attr = CONST['deleted']
else:
attr = None
- return u'%s %s' % (self.title, attr) if attr is not None else self.title
+ if (attr is not None):
+ return u'%s %s' % (self.title, attr)
+ else:
+ self.title
def get_revision_url(self):
return reverse('question_revisions', args=[self.id])
@@ -517,7 +520,12 @@ 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
+ #python 2.4 issues - Adolfo Fitoria
+ #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()
diff --git a/forum/views.py b/forum/views.py
index 08a0e958..5d377c3f 100644
--- a/forum/views.py
+++ b/forum/views.py
@@ -1037,8 +1037,14 @@ def user_recent(request, user_id, user_view):
self.type_id = type
self.title = title
self.summary = summary
- self.title_link = u'/questions/%s/%s#%s' %(question_id, title, answer_id)\
- if int(answer_id) > 0 else u'/questions/%s/%s' %(question_id, title)
+ #python 2.4 issue - Adolfo Fitoria
+ #self.title_link = u'/questions/%s/%s#%s' %(question_id, title, answer_id)\
+ # if int(answer_id) > 0 else u'/questions/%s/%s' %(question_id, title)
+ if (int(answer_id)>0):
+ self.title_link = u'/questions/%s/%s#%s' %(question_id, title, answer_id)
+ else:
+ self.title_link = u'/questions/%s/%s' %(question_id, title)
+
class AwardEvent:
def __init__(self, time, type, id):
self.time = time