Skip to content
Snippets Groups Projects
Commit 740340e5 authored by Auriane Strasser's avatar Auriane Strasser
Browse files

change visits/admin.py to redirect to users

parent 70bcc8c6
Branches
No related tags found
No related merge requests found
...@@ -112,14 +112,14 @@ reject_selected_participations.short_description = ( ...@@ -112,14 +112,14 @@ reject_selected_participations.short_description = (
class ParticipationAdmin(admin.ModelAdmin): class ParticipationAdmin(admin.ModelAdmin):
"""Admin panel for visit participations.""" """Admin panel for visit participations."""
list_display = ('submitted', 'visit', 'link_to_user', list_display = ('submitted', 'visit', 'user_link',
'accepted', 'present') 'accepted', 'present')
list_filter = ('submitted', 'accepted', 'present') list_filter = ('submitted', 'accepted', 'present')
actions = [accept_selected_participations, reject_selected_participations] actions = [accept_selected_participations, reject_selected_participations]
def link_to_user (self,obj): def user_link (self,book):
link=reverse("admin:visits_user_change", args=[obj.user.id]) url=reverse("admin:visits_user_change", args=[book.user.id])
return u'<a href="%s">%s</a>' % (link,obj.user.email) return mark_safe(link)
link_to_user.allow_tags=True user_link.short_description = 'Utilisateur'
@admin.register(Visit.organizers.through) @admin.register(Visit.organizers.through)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment