Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trans: show contestants of a user on the admin interface #34

Open
wants to merge 1 commit into
base: refresh
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions trans/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class Meta:
fields = ('username', 'country', 'language', 'raw_password', 'is_onsite', 'is_translating')
import_id_fields = ('username',)

class ContestantInline(admin.TabularInline):
model = Contestant

@admin.register(User)
class CustomUserAdmin(ImportExportMixin, UserAdmin):
Expand All @@ -58,6 +60,8 @@ class CustomUserAdmin(ImportExportMixin, UserAdmin):

filter_horizontal = ()

inlines = (ContestantInline, )

def translate_versions(self, obj):
return mark_safe('<a href="%s">%s</a>' % (reverse('user_trans', kwargs={'username': obj.username}), 'Translations'))

Expand Down