Display correct username on shelf page

This commit is contained in:
Mouse Reeve 2020-02-21 16:40:49 -08:00
parent 78336531c9
commit c889fab6d1
2 changed files with 6 additions and 2 deletions

View file

@ -3,7 +3,7 @@
<div id="content">
<div>
<h2>{% include 'snippets/username.html' %} > {{ shelf.name }}</h2>
<h2>{% include 'snippets/username.html' with user=user %} > {{ shelf.name }}</h2>
{% include 'snippets/shelf.html' with shelf=shelf ratings=ratings %}
</div>
</div>

View file

@ -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