From 2e58bc1f968fbb013e8b980c8fbc64643aff2f8f Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Sun, 12 Jan 2020 21:22:19 +0100 Subject: [PATCH] Store the email in lower case and do the comparison in lower case as well Otherwise we end up trying to update a component just because the case is different while the account on the bugzilla is the same. Signed-off-by: Pierre-Yves Chibon --- distgit_bugzilla_sync/script.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/distgit_bugzilla_sync/script.py b/distgit_bugzilla_sync/script.py index 9d9ded7..aba8dfb 100644 --- a/distgit_bugzilla_sync/script.py +++ b/distgit_bugzilla_sync/script.py @@ -331,7 +331,7 @@ class BugzillaProxy: for watcher in cclist: bz_email = self._get_bugzilla_email(watcher) if bz_email: - initial_cc_emails.append(bz_email) + initial_cc_emails.append(bz_email.lower()) initial_cc_fasnames.append(watcher) else: self.errors.append( @@ -346,7 +346,7 @@ class BugzillaProxy: # have to do this manually owner_email = self._get_bugzilla_email(owner) if owner_email not in initial_cc_emails: - initial_cc_emails.append(owner_email) + initial_cc_emails.append(owner_email.lower()) initial_cc_fasnames.append(owner) # Lookup product @@ -377,20 +377,20 @@ class BugzillaProxy: data = {} # Check for changes to the owner, qacontact, or description - if product[pkg_key]['initialowner'] != owner_email: + if product[pkg_key]['initialowner'].lower() != owner_email.lower(): data['initialowner'] = owner_email if description and product[pkg_key]['description'] != description: data['description'] = description - if qacontact and product[pkg_key]['initialqacontact'] != qacontact_email: + if qacontact and product[pkg_key]['initialqacontact'].lower() != qacontact_email.lower(): data['initialqacontact'] = qacontact_email if len(product[pkg_key]['initialcclist']) != len(initial_cc_emails): data['initialcclist'] = initial_cc_emails else: for cc_member in product[pkg_key]['initialcclist']: - if cc_member not in initial_cc_emails: + if cc_member.lower() not in initial_cc_emails: data['initialcclist'] = initial_cc_emails break