consistently normalize email addresses as keys

Otherwise, this could make looking up user names in the
inverted_user_cache dictionary to fail.

Signed-off-by: Nils Philippsen <nils@redhat.com>
This commit is contained in:
Nils Philippsen 2019-11-22 12:54:14 +01:00
parent 5c4a6dc32a
commit 8305e989c7

View file

@ -213,13 +213,13 @@ class BugzillaProxy:
return return
self.user_cache[username] = { self.user_cache[username] = {
'bugzilla_email': bz_email} 'bugzilla_email': bz_email}
self.inverted_user_cache[bz_email] = username
else: else:
person = self.fas.person_by_username(username) person = self.fas.person_by_username(username)
bz_email = person.get('bugzilla_email', None) bz_email = person.get('bugzilla_email', None)
if bz_email is None: if bz_email is None:
return return
self.user_cache[username] = {'bugzilla_email': bz_email} self.user_cache[username] = {'bugzilla_email': bz_email}
bz_email = bz_email.lower()
self.inverted_user_cache[bz_email] = username self.inverted_user_cache[bz_email] = username
return bz_email return bz_email