Skip to content

Commit

Permalink
fix: Update POST request handling and improve participant count check
Browse files Browse the repository at this point in the history
  • Loading branch information
albertoleoncio committed Jan 19, 2025
1 parent a4a4ec9 commit 2b72912
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contests/handlers/counter.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def get_context(self, request):
profile=request.user.profile
).user_status == 'G' else False

if request.method == 'POST':
if manager and request.method == 'POST' and request.POST.get('user_id'):
success = self.reset_participant(request)
else:
success = False
Expand All @@ -165,5 +165,5 @@ def reset_participant(self, request):
contest=self.contest,
participant=Participant.objects.get(contest=self.contest, local_id=participant_id)
).update(last_evaluation=None)
return True if participant.count() > 0 else False
return True if participant > 0 else False

0 comments on commit 2b72912

Please sign in to comment.