Skip to content

Commit

Permalink
Use consistent capitals for admin column descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
int-y1 committed Aug 26, 2023
1 parent 79be4af commit 57516b8
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions judge/admin/contest.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,10 @@ def recalculate_results(self, request, queryset):
'%d participations recalculated.',
count) % count)

@admin.display(description=_('username'), ordering='user__user__username')
@admin.display(description=_('Username'), ordering='user__user__username')
def username(self, obj):
return obj.user.username

@admin.display(description=_('virtual'), ordering='virtual')
@admin.display(description=_('Virtual'), ordering='virtual')
def show_virtual(self, obj):
return obj.virtual or '-'
4 changes: 2 additions & 2 deletions judge/admin/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(self, *args, **kwargs):
super(NavigationBarAdmin, self).__init__(*args, **kwargs)
self.__save_model_calls = 0

@admin.display(description=_('link path'))
@admin.display(description=_('Link path'))
def linked_path(self, obj):
return format_html('<a href="{0}" target="_blank">{0}</a>', obj.path)

Expand Down Expand Up @@ -151,7 +151,7 @@ def has_change_permission(self, request, obj=None):
def has_delete_permission(self, request, obj=None):
return False

@admin.display(description=_('object'), ordering='object_repr')
@admin.display(description=_('Object'), ordering='object_repr')
def object_link(self, obj):
if obj.is_deletion():
link = obj.object_repr
Expand Down
2 changes: 1 addition & 1 deletion judge/admin/organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,6 @@ class OrganizationRequestAdmin(admin.ModelAdmin):
list_display = ('username', 'organization', 'state', 'time')
readonly_fields = ('user', 'organization', 'request_class')

@admin.display(description=_('username'), ordering='user__user__username')
@admin.display(description=_('Username'), ordering='user__user__username')
def username(self, obj):
return obj.user.user.username
2 changes: 1 addition & 1 deletion judge/admin/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def has_change_permission(self, request, obj=None):
def lookup_allowed(self, key, value):
return super().lookup_allowed(key, value) or key in ('problem__code',)

@admin.display(description=_('problem'), ordering='problem__name')
@admin.display(description=_('Problem'), ordering='problem__name')
def linked_problem(self, obj):
link = reverse('problem_detail', args=[obj.problem.code])
return format_html('<a href="{0}">{1}</a>', link, obj.problem.name)
2 changes: 1 addition & 1 deletion judge/admin/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def email(self, obj):
def timezone_full(self, obj):
return obj.timezone

@admin.display(description=_('date joined'), ordering='user__date_joined')
@admin.display(description=_('Date joined'), ordering='user__date_joined')
def date_joined(self, obj):
return obj.user.date_joined

Expand Down

0 comments on commit 57516b8

Please sign in to comment.