def can_accept_answer(self, answer):\r
return False\r
\r
+ def can_create_tags(self):\r
+ return False\r
+\r
def can_edit_post(self, post):\r
return False\r
\r
def get_vote_count_today(self):\r
today = datetime.date.today()\r
return self.actions.filter(canceled=False, action_type__in=("voteup", "votedown"),\r
- action_date__range=(today - datetime.timedelta(days=1), today)).count()\r
+ action_date__gte=(today - datetime.timedelta(days=1))).count()\r
\r
def get_reputation_by_upvoted_today(self):\r
today = datetime.datetime.now()\r
def get_flagged_items_count_today(self):\r
today = datetime.date.today()\r
return self.actions.filter(canceled=False, action_type="flag",\r
- action_date__range=(today - datetime.timedelta(days=1), today)).count()\r
+ action_date__gte=(today - datetime.timedelta(days=1))).count()\r
\r
@true_if_is_super_or_staff\r
def can_view_deleted_post(self, post):\r
def can_accept_answer(self, answer):\r
return self == answer.question.author\r
\r
+ @true_if_is_super_or_staff\r
+ def can_create_tags(self):\r
+ return self.reputation >= int(settings.REP_TO_CREATE_TAGS)\r
+\r
@true_if_is_super_or_staff\r
def can_edit_post(self, post):\r
return self == post.author or self.reputation >= int(settings.REP_TO_EDIT_OTHERS\r
def can_upload_files(self):\r
return self.reputation >= int(settings.REP_TO_UPLOAD)\r
\r
+ def check_password(self, old_passwd):\r
+ self.__dict__.update(self.__class__.objects.filter(id=self.id).values('password')[0])\r
+ return DjangoUser.check_password(self, old_passwd)\r
+\r
+\r
class Meta:\r
app_label = 'forum'\r
\r