Slight update to the suggestions etag

This commit is contained in:
Trenton H
2024-01-15 10:17:16 -08:00
parent 2031a58a76
commit 15f7c93158
2 changed files with 2 additions and 2 deletions

View File

@@ -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]:

View File

@@ -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()