Implement integer field randomisation

This commit is contained in:
2022-08-27 13:18:24 +01:00
parent 9b2d61831b
commit ba41a0b26b
6 changed files with 75 additions and 8 deletions

View File

@@ -14,6 +14,7 @@ from core.views.helpers import (
hash_list,
hash_lookup,
obfuscate_list,
randomise_list,
)
# from json import dumps
@@ -571,6 +572,9 @@ def query_results(
if settings.OBFUSCATION:
obfuscate_list(request.user, results_parsed)
if settings.RANDOMISATION:
randomise_list(request.user, results_parsed)
# process_list(reqults)
# IMPORTANT! - DO NOT PASS query_params to the user!
@@ -586,6 +590,9 @@ def query_results(
if settings.DELAY_RESULTS:
if not request.user.has_perm("bypass_delay"):
context["delay"] = settings.DELAY_DURATION
if settings.RANDOMISATION:
if not request.user.has_perm("bypass_randomisation"):
context["randomised"] = True
return context