Whoops, make sure we correctly fetch the user to display entries for on the home page if nobody is logged in

This commit is contained in:
Danielle McLean 2018-01-29 08:48:56 +11:00
parent f6a0adfb56
commit b2b017c1bd
Signed by untrusted user: 00dani
GPG key ID: 5A5D2D1AFF12EEC5

View file

@ -18,7 +18,7 @@ def index(request, page):
return reverse('home:index', kwargs=kwargs) return reverse('home:index', kwargs=kwargs)
user = request.user user = request.user
if not user: if not hasattr(user, 'entries'):
user = get_object_or_404(User, pk=1) user = get_object_or_404(User, pk=1)
entries = user.entries.filter(kind__in=kinds.on_home) entries = user.entries.filter(kind__in=kinds.on_home)