Skip to content

Commit

Permalink
🖊️ Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
oakbani committed Jun 7, 2018
1 parent 0a7e74f commit 9e05758
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions optimizely/event_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
from abc import abstractproperty

from . import version
from .helpers import enums
from .helpers import event_tag_utils
from .helpers.enums import ControlAttributes


class Event(object):
Expand Down Expand Up @@ -81,7 +81,7 @@ def _get_anonymize_ip(self):
""" Get IP anonymization bool
Returns:
bool 'anonymizeIP' value in the datafile.
Boolean representing whether IP anonymization is enabled or not.
"""

return self.config.get_anonymize_ip_value()
Expand All @@ -90,7 +90,7 @@ def _get_bot_filtering(self):
""" Get bot filtering bool
Returns:
'botFiltering' value in the datafile.
Boolean representing whether bot filtering is enabled or not.
"""

return self.config.get_bot_filtering_value()
Expand Down Expand Up @@ -182,7 +182,7 @@ def _get_attributes(self, attributes):
if not attributes:
return []

for attribute_key in sorted(attributes.keys()):
for attribute_key in attributes.keys():
attribute_value = attributes.get(attribute_key)
# Omit falsy attribute values
if attribute_value:
Expand All @@ -192,16 +192,17 @@ def _get_attributes(self, attributes):
'entity_id': attribute_id,
'key': attribute_key,
'type': self.EventParams.CUSTOM,
'value': attribute_value,
'value': attribute_value
})

# Append Bot Filtering Attribute
if isinstance(self._get_bot_filtering(), bool):
bot_filtering_value = self._get_bot_filtering()
if isinstance(bot_filtering_value, bool):
params.append({
'entity_id': ControlAttributes.BOT_FILTERING,
'key': ControlAttributes.BOT_FILTERING,
'entity_id': enums.ControlAttributes.BOT_FILTERING,
'key': enums.ControlAttributes.BOT_FILTERING,
'type': self.EventParams.CUSTOM,
'value': self._get_bot_filtering(),
'value': bot_filtering_value
})

return params
Expand Down

0 comments on commit 9e05758

Please sign in to comment.