Skip to content

Commit

Permalink
votes/admin: show str representation of token, so it is easier to cop…
Browse files Browse the repository at this point in the history
…y into 3 form fields
  • Loading branch information
rine committed Dec 17, 2021
1 parent 41a84ef commit b63f3ec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion meinberlin/apps/votes/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ class VotingTokenAdmin(admin.ModelAdmin):
'token', 'module', 'is_active', 'allowed_votes'
)
readonly_fields = ('token',)
list_display = ('token', 'project', 'module', 'module_name', 'is_active')
list_display = ('token_representation', 'project', 'module', 'module_name',
'is_active')
list_filter = ('module__project',)

def module_name(self, token):
return token.module.name

def token_representation(self, token):
return str(token)

module_name.short_description = 'Module Name'


Expand Down

0 comments on commit b63f3ec

Please sign in to comment.