Uses new visible/editable/deleteable functions
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
""" non-interactive pages """
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.core.paginator import Paginator
|
||||
from django.http import Http404
|
||||
from django.shortcuts import redirect
|
||||
from django.template.response import TemplateResponse
|
||||
from django.utils import timezone
|
||||
@ -77,8 +78,12 @@ class User(View):
|
||||
goal = models.AnnualGoal.objects.filter(
|
||||
user=user, year=timezone.now().year
|
||||
).first()
|
||||
if goal and not goal.visible_to_user(request.user):
|
||||
goal = None
|
||||
if goal:
|
||||
try:
|
||||
goal.raise_visible_to_user(request.user)
|
||||
except Http404:
|
||||
goal = None
|
||||
|
||||
data = {
|
||||
"user": user,
|
||||
"is_self": is_self,
|
||||
|
Reference in New Issue
Block a user