From: rubenwardy Date: Mon, 19 Oct 2020 14:30:45 +0000 (+0100) Subject: Fix crash on email templating X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=6503a820946a4b09bb6aeea65e850e7146f7c301;p=cheatdb.git Fix crash on email templating --- diff --git a/app/template_filters.py b/app/template_filters.py index 39d3806..6f31ea0 100644 --- a/app/template_filters.py +++ b/app/template_filters.py @@ -16,7 +16,7 @@ def inject_functions(): @app.context_processor def inject_todo(): todo_list_count = None - if current_user.is_authenticated and current_user.canAccessTodoList(): + if current_user and current_user.is_authenticated and current_user.canAccessTodoList(): todo_list_count = Package.query.filter_by(state=PackageState.READY_FOR_REVIEW).count() todo_list_count += PackageRelease.query.filter_by(approved=False, task_id=None).count()