forked from mirrors/bookwyrm
Make sure goal exists before checking perms
This commit is contained in:
parent
edf3fad54d
commit
b552634a87
1 changed files with 1 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue