diff --git a/app/dashboard/admin.py b/app/dashboard/admin.py index 4ef32fcfcc4..166f8912e73 100644 --- a/app/dashboard/admin.py +++ b/app/dashboard/admin.py @@ -85,8 +85,22 @@ class ToolVoteAdmin(admin.ModelAdmin): class BountyInvitesAdmin(admin.ModelAdmin): - raw_id_fields = ['bounty'] + raw_id_fields = ['bounty', 'inviter', 'invitee'] ordering = ['-id'] + readonly_fields = [ 'from_inviter', 'to_invitee'] + list_display = [ 'id', 'from_inviter', 'to_invitee', 'bounty_url'] + + def bounty_url(self, obj): + bounty = obj.bounty.first() + return format_html("{}", mark_safe(bounty.url), mark_safe(bounty.url)) + + def from_inviter(self, obj): + """Get the profile handle.""" + return "\n".join([p.username for p in obj.inviter.all()]) + + def to_invitee(self, obj): + """Get the profile handle.""" + return "\n".join([p.username for p in obj.invitee.all()]) class InterestAdmin(admin.ModelAdmin): diff --git a/app/dashboard/templates/dashboard/users.html b/app/dashboard/templates/dashboard/users.html index 8879e8382aa..71c3ee418df 100644 --- a/app/dashboard/templates/dashboard/users.html +++ b/app/dashboard/templates/dashboard/users.html @@ -65,24 +65,25 @@
[[ numUsers ]] users found
-