#40 Ensure there is no trailing spaces on email retrieved for users/groups
Merged 3 years ago by pingou. Opened 3 years ago by pingou.

@@ -66,9 +66,9 @@ 

      if bz_email is None:

          return

  

-     bz_email = bz_email.lower()

+     bz_email = bz_email.lower().strip()

      bz_email = email_overrides.get(bz_email, bz_email)

-     return bz_email

+     return bz_email.strip()

  

  

  def get_bz_email_group(groupname, email_overrides):
@@ -80,9 +80,9 @@ 

      if bz_email is None:

          return

  

-     bz_email = bz_email.lower()

+     bz_email = bz_email.lower().strip()

      bz_email = email_overrides.get(bz_email, bz_email)

-     return bz_email

+     return bz_email.strip()

  

  

  def get_user_by_email(email: str) -> dict:

We ran into this recently in Fedora were a trailing space led to some
weird error. Let's try to avoid this in toddlers.

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

Build failed.

  • tox : FAILURE in 8m 11s

rebased onto 34c4cd5

3 years ago

Build succeeded.

  • tox : SUCCESS in 9m 54s

LGTM, I could imagine what could whitespace do in the e-mail

Thanks for the review!

LGTM, I could imagine what could whitespace do in the e-mail

This should fix the issue we had in the distgit-bugzilla-sync as well and that we found out via https://pagure.io/fedora-infrastructure/issue/6157

Pull-Request has been merged by pingou

3 years ago