Skip to content

Commit

Permalink
Add limit for contest time limit
Browse files Browse the repository at this point in the history
  • Loading branch information
cuom1999 committed Aug 14, 2024
1 parent 37cdd2d commit 091c662
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions judge/models/contest.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,10 @@ def save(self, *args, **kwargs):
if self.end_time > one_year_later:
self.end_time = one_year_later

max_duration = timedelta(days=7)
if self.time_limit and self.time_limit > max_duration:
self.time_limit = max_duration

super().save(*args, **kwargs)

def is_in_contest(self, user):
Expand Down

0 comments on commit 091c662

Please sign in to comment.