X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/204b196b015876b87379c526b3f92e7e396464bd..5084e9c7ae5281439d6b78f599821e7915844850:/forum/models/user.py diff --git a/forum/models/user.py b/forum/models/user.py index 36f0e90..b18047e 100644 --- a/forum/models/user.py +++ b/forum/models/user.py @@ -156,7 +156,10 @@ class User(BaseModel, DjangoUser): @property def last_activity(self): - return self.actions.order_by('-action_date')[0].action_date + try: + return self.actions.order_by('-action_date')[0].action_date + except: + return None @property def gravatar(self): @@ -310,7 +313,7 @@ class User(BaseModel, DjangoUser): @true_if_is_super_or_staff def can_reopen_question(self, question): - return self == question.author and self.reputation >= settings.REP_TO_REOPEN_OWN + return self == question.author and self.reputation >= int(settings.REP_TO_REOPEN_OWN) @true_if_is_super_or_staff def can_delete_post(self, post):