From 15f7c9315841604fcd8b6ff55d00278cec4bb863 Mon Sep 17 00:00:00 2001 From: Trenton H <797416+stumpylog@users.noreply.github.com> Date: Mon, 15 Jan 2024 10:17:16 -0800 Subject: [PATCH] Slight update to the suggestions etag --- src/documents/conditionals.py | 2 +- src/documents/tests/test_api_documents.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/documents/conditionals.py b/src/documents/conditionals.py index 23cb9c6af..07e6850fb 100644 --- a/src/documents/conditionals.py +++ b/src/documents/conditionals.py @@ -25,7 +25,7 @@ def suggestions_etag(request, pk: int) -> Optional[str]: return None _ = pickle.load(f) last_auto_type_hash: bytes = pickle.load(f) - return str(last_auto_type_hash) + str(settings.NUMBER_OF_SUGGESTED_DATES) + return f"{last_auto_type_hash}:{settings.NUMBER_OF_SUGGESTED_DATES}" def suggestions_last_modified(request, pk: int) -> Optional[datetime]: diff --git a/src/documents/tests/test_api_documents.py b/src/documents/tests/test_api_documents.py index a3d440699..7b81c8df0 100644 --- a/src/documents/tests/test_api_documents.py +++ b/src/documents/tests/test_api_documents.py @@ -1336,7 +1336,7 @@ class TestDocumentApi(DirectoriesMixin, DocumentConsumeDelayMixin, APITestCase): self.assertIn("ETag", response.headers) self.assertEqual( response.headers["ETag"], - f"\"b'thisisachecksum'{settings.NUMBER_OF_SUGGESTED_DATES}\"", + f"\"b'thisisachecksum':{settings.NUMBER_OF_SUGGESTED_DATES}\"", ) mocked_pickle_load.rest_mock()