From b552634a878b9e1fee4237a0815ad109a58cab0d Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sun, 11 Apr 2021 09:58:03 -0700 Subject: [PATCH] Make sure goal exists before checking perms --- bookwyrm/views/user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bookwyrm/views/user.py b/bookwyrm/views/user.py index d2c9c2eb..d666f064 100644 --- a/bookwyrm/views/user.py +++ b/bookwyrm/views/user.py @@ -80,7 +80,7 @@ class User(View): goal = models.AnnualGoal.objects.filter( user=user, year=timezone.now().year ).first() - if not goal.visible_to_user(request.user): + if goal and not goal.visible_to_user(request.user): goal = None data = { "user": user,