Don't try to display subscriptions when no user is authenticated
This commit is contained in:
parent
d2ff139c51
commit
47f117abe6
@ -43,9 +43,13 @@ def taskDetail(request, tool_slug, task_slug):
|
||||
context = {
|
||||
'tool': tool,
|
||||
'task': task,
|
||||
'task_subs': task.grouptasksubscription_set.filter(group__user=request.user),
|
||||
'tool_subs': tool.grouptoolsubscription_set.filter(group__user=request.user),
|
||||
'events': events,
|
||||
'form': form,
|
||||
}
|
||||
|
||||
if request.user.is_authenticated:
|
||||
context.update({
|
||||
'task_subs': task.grouptasksubscription_set.filter(group__user=request.user),
|
||||
'tool_subs': tool.grouptoolsubscription_set.filter(group__user=request.user),
|
||||
})
|
||||
return render(request, 'tasks/taskDetail.djhtml', context)
|
||||
|
Loading…
Reference in New Issue
Block a user