Skip to content

Commit

Permalink
convert locked_after to is_locked + migration
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonLovesDoggo committed Jan 6, 2024
1 parent f0e86cd commit d60f29a
Show file tree
Hide file tree
Showing 4 changed files with 184 additions and 6 deletions.
4 changes: 2 additions & 2 deletions judge/admin/contest.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class ContestAdmin(NoBatchDeleteMixin, VersionAdmin):
(None, {'fields': ('key', 'name', 'authors', 'curators', 'testers', 'tester_see_submissions',
'tester_see_scoreboard', 'spectators')}),
(_('Settings'), {'fields': ('is_visible', 'use_clarifications', 'hide_problem_tags', 'hide_problem_authors',
'show_short_display', 'run_pretests_only', 'locked_after', 'scoreboard_visibility',
'show_short_display', 'run_pretests_only', 'is_locked', 'scoreboard_visibility',
'points_precision')}),
(_('Scheduling'), {'fields': ('start_time', 'end_time', 'time_limit')}),
(_('Details'), {'fields': ('description', 'og_image', 'logo_override_image', 'tags', 'summary')}),
Expand All @@ -130,7 +130,7 @@ class ContestAdmin(NoBatchDeleteMixin, VersionAdmin):
'join_organizations', 'view_contest_scoreboard', 'view_contest_submissions')}),
(_('Justice'), {'fields': ('banned_users',)}),
)
list_display = ('key', 'name', 'is_visible', 'is_rated', 'locked_after', 'start_time', 'end_time', 'time_limit',
list_display = ('key', 'name', 'is_visible', 'is_rated', 'is_locked', 'start_time', 'end_time', 'time_limit',
'user_count')
search_fields = ('key', 'name')
inlines = [ContestProblemInline]
Expand Down
4 changes: 2 additions & 2 deletions judge/admin/submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def get_formset(self, request, obj=None, **kwargs):

class SubmissionAdmin(VersionAdmin):
readonly_fields = ('user', 'problem', 'date', 'judged_date')
fields = ('user', 'problem', 'date', 'judged_date', 'locked_after', 'time', 'memory', 'points', 'language',
fields = ('user', 'problem', 'date', 'judged_date', 'is_locked', 'time', 'memory', 'points', 'language',
'status', 'result', 'case_points', 'case_total', 'judged_on', 'error')
actions = ('judge', 'recalculate_score')
list_display = ('id', 'problem_code', 'problem_name', 'user_column', 'execution_time', 'pretty_memory',
Expand All @@ -129,7 +129,7 @@ class SubmissionAdmin(VersionAdmin):
def get_readonly_fields(self, request, obj=None):
fields = self.readonly_fields
if not request.user.has_perm('judge.lock_submission'):
fields += ('locked_after',)
fields += ('is_locked',)
return fields

def get_queryset(self, request):
Expand Down
Loading

0 comments on commit d60f29a

Please sign in to comment.