You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the middleware function process_template_response, the following line is used:
request.session[EXPERIMENT_PREFIX+treatment.experiment.slug] = treatment.slug
This sets the treatment.slug in the session (not the treatment.id). What if there are +2 treatments with the same treatment.slug?
The treatment.slug is later retrieved in middleware function process_view, to reverse find the Treatment it belongs to.
treatment_slug = request.session[EXPERIMENT_PREFIX+goal.experiment.slug]
treatment = Treatment.objects.get(slug=treatment_slug)
If +2 Treatments use the same treatment.slug, then the developer cannot be sure which will be retrieved (or perhaps an error will occur?)
The text was updated successfully, but these errors were encountered:
In the middleware function process_template_response, the following line is used:
request.session[EXPERIMENT_PREFIX+treatment.experiment.slug] = treatment.slug
This sets the treatment.slug in the session (not the treatment.id). What if there are +2 treatments with the same treatment.slug?
The treatment.slug is later retrieved in middleware function process_view, to reverse find the Treatment it belongs to.
treatment_slug = request.session[EXPERIMENT_PREFIX+goal.experiment.slug]
treatment = Treatment.objects.get(slug=treatment_slug)
If +2 Treatments use the same treatment.slug, then the developer cannot be sure which will be retrieved (or perhaps an error will occur?)
The text was updated successfully, but these errors were encountered: