mirror of
https://github.com/zulip/zulip.git
synced 2025-11-15 19:31:58 +00:00
python: Simplify with str.removeprefix, str.removesuffix.
These are available in Python ≥ 3.9. https://docs.python.org/3/library/stdtypes.html#str.removeprefix Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
1ec4539550
commit
91ade25ba3
@@ -14,7 +14,7 @@ def compute_mit_user_fullname(email: str) -> str:
|
||||
if hesiod_name != "":
|
||||
return hesiod_name
|
||||
elif match_user:
|
||||
return match_user.group(1).lower() + "@" + match_user.group(2).upper()[1:]
|
||||
return match_user.group(1).lower() + "@" + match_user.group(2).upper().removeprefix("|")
|
||||
except DNS.Base.ServerError:
|
||||
pass
|
||||
except Exception:
|
||||
|
||||
Reference in New Issue
Block a user