Skip to content

Commit

Permalink
etag tweak (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
domdinicola authored Oct 18, 2022
1 parent c1ee51d commit 51330c9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/etools_datamart/apps/security/cache.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import hashlib

from rest_framework_extensions.key_constructor.bits import KeyBitBase

from etools_datamart.api.filtering import CountryFilter
Expand All @@ -11,4 +13,5 @@ def get_data(self, params, view_instance, view_method, request, args, kwargs):
if CountryFilter.query_param not in request.GET:
value = get_allowed_schemas(request.user)

return {'countries': str(value)}
hashed_value = hashlib.md5(str(value).encode()).hexdigest()
return {'countries': hashed_value}

0 comments on commit 51330c9

Please sign in to comment.