tests goal views

This commit is contained in:
Mouse Reeve
2021-01-16 13:29:28 -08:00
parent ec79b10088
commit 8532c9a46b
2 changed files with 116 additions and 2 deletions

View File

@ -24,7 +24,7 @@ class Goal(View):
year=year, user=user
).first()
if not goal and user != request.user:
return redirect('/')
return HttpResponseNotFound()
if goal and not object_visible_to_user(request.user, goal):
return HttpResponseNotFound()
@ -58,7 +58,7 @@ class Goal(View):
'year': year,
}
return TemplateResponse(request, 'goal.html', data)
form.save()
goal = form.save()
if request.POST.get('post-status'):
# create status, if appropraite