Use consistent capitals for admin column descriptions

This commit is contained in:
int-y1 2023-08-26 18:02:28 -04:00 committed by Evan Zhang
parent 98c755706a
commit d6dd630b3e
4 changed files with 11 additions and 11 deletions

View File

@ -51,7 +51,7 @@ class CommentAdmin(VersionAdmin):
'%d comments successfully unhidden.',
count) % count)
@admin.display(description=_('Associated page'), ordering='page')
@admin.display(description=_('associated page'), ordering='page')
def linked_page(self, obj):
link = obj.link
if link is not None:

View File

@ -174,7 +174,7 @@ class ProblemAdmin(NoBatchDeleteMixin, VersionAdmin):
fields += ('description',)
return fields
@admin.display(description=_('Authors'))
@admin.display(description=_('authors'))
def show_authors(self, obj):
return ', '.join(map(attrgetter('user.username'), obj.authors.all()))

View File

@ -92,15 +92,15 @@ class ProfileAdmin(NoBatchDeleteMixin, VersionAdmin):
return format_html('<a href="{0}" style="white-space:nowrap;">{1}</a>',
obj.get_absolute_url(), gettext('View on site'))
@admin.display(description=_('User'), ordering='user__username')
@admin.display(description=_('user'), ordering='user__username')
def admin_user_admin(self, obj):
return obj.username
@admin.display(description=_('Email'), ordering='user__email')
@admin.display(description=_('email'), ordering='user__email')
def email(self, obj):
return obj.user.email
@admin.display(description=_('Timezone'), ordering='timezone')
@admin.display(description=_('timezone'), ordering='timezone')
def timezone_full(self, obj):
return obj.timezone

View File

@ -207,23 +207,23 @@ class SubmissionAdmin(VersionAdmin):
'%d submissions were successfully rescored.',
len(submissions)) % len(submissions))
@admin.display(description=_('Problem code'), ordering='problem__code')
@admin.display(description=_('problem code'), ordering='problem__code')
def problem_code(self, obj):
return obj.problem.code
@admin.display(description=_('Problem name'), ordering='problem__name')
@admin.display(description=_('problem name'), ordering='problem__name')
def problem_name(self, obj):
return obj.problem.name
@admin.display(description=_('User'), ordering='user__user__username')
@admin.display(description=_('user'), ordering='user__user__username')
def user_column(self, obj):
return obj.user.user.username
@admin.display(description=_('Time'), ordering='time')
@admin.display(description=_('time'), ordering='time')
def execution_time(self, obj):
return round(obj.time, 2) if obj.time is not None else 'None'
@admin.display(description=_('Memory'), ordering='memory')
@admin.display(description=_('memory'), ordering='memory')
def pretty_memory(self, obj):
memory = obj.memory
if memory is None:
@ -233,7 +233,7 @@ class SubmissionAdmin(VersionAdmin):
else:
return gettext('%.2f MB') % (memory / 1024)
@admin.display(description=_('Language'), ordering='language__name')
@admin.display(description=_('language'), ordering='language__name')
def language_column(self, obj):
return obj.language.name