Change our_person() in apply_events() to use user_id.

This is a pretty minor change, but it makes it clear that we
have user_id in all the relevant states/events, so we might as
well use that for the check, since email is mutable and
slightly more difficult to reason about.
This commit is contained in:
Steve Howell
2017-01-21 06:30:55 -08:00
committed by Tim Abbott
parent e2afab142a
commit 4ea7e80be1

View File

@@ -3178,7 +3178,7 @@ def apply_events(state, events, user_profile):
def our_person(p):
# type: (Dict[str, Any]) -> bool
return p['email'] == person['email']
return p['user_id'] == person['user_id']
if event['op'] == "add":
state['realm_users'].append(person)