fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Better map.
[wolnelektury.git]
/
src
/
wolnelektury
/
abtests.py
diff --git
a/src/wolnelektury/abtests.py
b/src/wolnelektury/abtests.py
index
7fde579
..
6dd0ea2
100644
(file)
--- a/
src/wolnelektury/abtests.py
+++ b/
src/wolnelektury/abtests.py
@@
-4,10
+4,12
@@
from django.conf import settings
def context_processor(request):
ab = {}
def context_processor(request):
ab = {}
+ overrides = getattr(settings, 'AB_TESTS_OVERRIDES', {})
for abtest, nvalues in settings.AB_TESTS.items():
for abtest, nvalues in settings.AB_TESTS.items():
- print(abtest, nvalues)
- ab[abtest] = hashlib.md5(
+ ab[abtest] = overrides.get(
+ abtest,
+ hashlib.md5(
(abtest + request.META['REMOTE_ADDR']).encode('utf-8')
).digest()[0] % nvalues
(abtest + request.META['REMOTE_ADDR']).encode('utf-8')
).digest()[0] % nvalues
-
print(ab
)
+
)
return {'AB': ab}
return {'AB': ab}