Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions src/sentry/models/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,15 +437,12 @@ def get_minimal_user(self):
email = self.snuba_data["email"]
username = self.snuba_data["username"]
ip_address = self.snuba_data["ip_address"]
else:
user_id = self.data["user_id"]
email = self.data["email"]
username = self.data["username"]
ip_address = self.data["ip_address"]
Comment on lines -440 to -444
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure I get why this did actually not work.

Copy link
Member Author

@lynnagara lynnagara Jan 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These properties are actually nested under self.data["user"] if they are present, this just gave a KeyError. The EventCommon implementation get_interface("user") takes care of loading them properly.


return User.to_python(
{"id": user_id, "email": email, "username": username, "ip_address": ip_address}
)
return User.to_python(
{"id": user_id, "email": email, "username": username, "ip_address": ip_address}
)

return super(SnubaEvent, self).get_minimal_user()

# If the data for these is available from snuba, we assume
# it was already normalized on the way in and we can just return
Expand Down