#47 Store the email in lower case and do the comparison in lower case as well
Merged 4 years ago by nphilipp. Opened 4 years ago by pingou.
fedora-infra/ pingou/distgit-bugzilla-sync case_insensitive_comparison  into  master

@@ -327,11 +327,13 @@ 

          '''

          # Turn the cclist into something usable by bugzilla

          initial_cc_emails = []

+         initial_cc_emails_lower = []

          initial_cc_fasnames = []

          for watcher in cclist:

              bz_email = self._get_bugzilla_email(watcher)

              if bz_email:

-                 initial_cc_emails.append(bz_email.lower())

+                 initial_cc_emails.append(bz_email)

+                 initial_cc_emails_lower.append(bz_email.lower())

                  initial_cc_fasnames.append(watcher)

              else:

                  self.errors.append(
@@ -345,8 +347,9 @@ 

          # Add owner to the cclist so comaintainers taking over a bug don't

          # 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.lower())

+         if owner_email.lower() not in initial_cc_emails_lower:

+             initial_cc_emails.append(owner_email)

+             initial_cc_emails_lower.append(owner_email.lower())

              initial_cc_fasnames.append(owner)

  

          # Lookup product
@@ -390,7 +393,7 @@ 

                  data['initialcclist'] = initial_cc_emails

              else:

                  for cc_member in product[pkg_key]['initialcclist']:

-                     if cc_member.lower() not in initial_cc_emails:

+                     if cc_member.lower() not in initial_cc_emails_lower:

                          data['initialcclist'] = initial_cc_emails

                          break

  

While keeping a recording of the case-sensitivity set by the user.

Signed-off-by: Pierre-Yves Chibon pingou@pingoured.fr

rebased onto 3ed514e

4 years ago

Pull-Request has been merged by nphilipp

4 years ago
Metadata