From c889fab6d15b69728395a772ba0ce08a5a780e61 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Fri, 21 Feb 2020 16:40:49 -0800 Subject: [PATCH] Display correct username on shelf page --- fedireads/templates/shelf.html | 2 +- fedireads/views.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/fedireads/templates/shelf.html b/fedireads/templates/shelf.html index afb6d52c1..df8b8b9ca 100644 --- a/fedireads/templates/shelf.html +++ b/fedireads/templates/shelf.html @@ -3,7 +3,7 @@
-

{% include 'snippets/username.html' %} > {{ shelf.name }}

+

{% include 'snippets/username.html' with user=user %} > {{ shelf.name }}

{% include 'snippets/shelf.html' with shelf=shelf ratings=ratings %}
diff --git a/fedireads/views.py b/fedireads/views.py index 76b9a1fe4..4aa128cf7 100644 --- a/fedireads/views.py +++ b/fedireads/views.py @@ -270,7 +270,11 @@ def shelf_page(request, username, shelf_identifier): return HttpResponseNotFound() shelf = models.Shelf.objects.get(user=user, identifier=shelf_identifier) - return TemplateResponse(request, 'shelf.html', {'shelf': shelf}) + data = { + 'shelf': shelf, + 'user': user, + } + return TemplateResponse(request, 'shelf.html', data) @login_required