Skip to content

Commit

Permalink
Fix in user_event_factory to use experiment_id to lookup variation fo…
Browse files Browse the repository at this point in the history
…r impression events.
  • Loading branch information
The-inside-man committed Jul 15, 2021
1 parent ab89cf4 commit 931f287
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions optimizely/event/user_event_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ def create_impression_event(
if not activated_experiment and rule_type is not enums.DecisionSources.ROLLOUT:
return None

variation, experiment_key = None, None
variation, experiment_id = None, None
if activated_experiment:
experiment_key = activated_experiment.key
experiment_id = activated_experiment.id

if variation_id and experiment_key:
variation = project_config.get_variation_from_id(experiment_key, variation_id)
if variation_id and experiment_id:
variation = project_config.get_variation_from_id_by_experiment_id(experiment_id, variation_id)
event_context = user_event.EventContext(
project_config.account_id, project_config.project_id, project_config.revision, project_config.anonymize_ip,
)
Expand Down

0 comments on commit 931f287

Please sign in to comment.