Update problem vote
This commit is contained in:
parent
77d7244ad2
commit
cb7e4559e4
4 changed files with 24 additions and 26 deletions
|
@ -375,12 +375,13 @@ class Problem(models.Model):
|
|||
|
||||
save.alters_data = True
|
||||
|
||||
def can_vote(self, user):
|
||||
def can_vote(self, request):
|
||||
user = request.user
|
||||
if not user.is_authenticated:
|
||||
return False
|
||||
|
||||
# If the user is in contest, nothing should be shown.
|
||||
if user.profile.current_contest:
|
||||
if request.in_contest_mode:
|
||||
return False
|
||||
|
||||
# If the user is not allowed to vote
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue