Skip to content

Commit

Permalink
Addressing feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
aliabbasrizvi committed Aug 21, 2018
1 parent f1157b0 commit 00c1ba9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions optimizely/event_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,14 @@ def _get_required_params_for_conversion(self, event_key, event_tags, decisions):
Dict consisting of the decisions and events info for conversion event.
"""
snapshot = {}
snapshot[self.EventParams.DECISIONS] = []

for experiment_id, variation_id in decisions:

experiment = self.config.get_experiment_from_id(experiment_id)

if variation_id:
snapshot.setdefault(self.EventParams.DECISIONS, []).append({
snapshot[self.EventParams.DECISIONS].append({
self.EventParams.EXPERIMENT_ID: experiment_id,
self.EventParams.VARIATION_ID: variation_id,
self.EventParams.CAMPAIGN_ID: experiment.layerId
Expand All @@ -274,7 +276,7 @@ def _get_required_params_for_conversion(self, event_key, event_tags, decisions):
if len(event_tags) > 0:
event_dict[self.EventParams.TAGS] = event_tags

snapshot.setdefault(self.EventParams.EVENTS, []).append(event_dict)
snapshot[self.EventParams.EVENTS] = [event_dict]
return snapshot

def create_impression_event(self, experiment, variation_id, user_id, attributes):
Expand Down

0 comments on commit 00c1ba9

Please sign in to comment.