diff --git a/app/helpers/url_safe_serializer.py b/app/helpers/url_safe_serializer.py index a8c0634337..1fe20b51db 100644 --- a/app/helpers/url_safe_serializer.py +++ b/app/helpers/url_safe_serializer.py @@ -6,4 +6,7 @@ def url_safe_serializer() -> URLSafeSerializer: - return URLSafeSerializer(current_app.secret_key, salt=cookie_session[EQ_SESSION_ID]) + secret_key = current_app.secret_key + if secret_key is None: + raise ValueError("Flask application secret key is not set.") + return URLSafeSerializer(secret_key, salt=cookie_session[EQ_SESSION_ID]) diff --git a/tests/app/data_model/conftest.py b/tests/app/data_model/conftest.py index d5d94b5313..4e182b8abb 100644 --- a/tests/app/data_model/conftest.py +++ b/tests/app/data_model/conftest.py @@ -1,4 +1,3 @@ -# pylint: disable=redefined-outer-name from datetime import datetime, timedelta, timezone import pytest diff --git a/tests/app/helpers/test_template_helpers.py b/tests/app/helpers/test_template_helpers.py index 9006c71333..bdf8b3bf6d 100644 --- a/tests/app/helpers/test_template_helpers.py +++ b/tests/app/helpers/test_template_helpers.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines from typing import Type import pytest