Skip to content
Snippets Groups Projects
Unverified Commit e2e2d196 authored by florimondmanca's avatar florimondmanca
Browse files

refactor participation user link display field

parent 4147b626
No related branches found
No related tags found
1 merge request!5Refactor participation user link display field
......@@ -113,14 +113,16 @@ reject_selected_participations.short_description = (
class ParticipationAdmin(admin.ModelAdmin):
"""Admin panel for visit participations."""
list_display = ('submitted', 'visit', 'user_link',
'accepted', 'present')
list_display = ('submitted', 'visit', 'user_link', 'accepted', 'present')
list_filter = ('submitted', 'accepted', 'present')
actions = [accept_selected_participations, reject_selected_participations]
def user_link (self,book):
url=reverse("admin:users_user_change", args=[book.user.id])
link = '<a href="%s">%s</a>' % (url, book.user.email)
def user_link(self, participation: Participation):
"""Return a link to the participation's user."""
url = reverse("admin:users_user_change", args=[participation.user.id])
link = f'<a href="{url}">{participation.user}</a>'
return mark_safe(link)
user_link.short_description = 'Utilisateur'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment