Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

ruff: Fix C416 Unnecessary `list` comprehension.

Anders Kaseorgdd7b09d71a10
diff --git a/zerver/forms.py b/zerver/forms.py
index 4c32272f4e9..565867e05e0 100644
--- a/zerver/forms.py
+++ b/zerver/forms.py
@@ -164,10 +164,7 @@ class RegistrationForm(RealmDetailsForm):
required=False,
coerce=int,
empty_value=None,
- choices=[
- (value, name)
- for value, name in UserProfile.EMAIL_ADDRESS_VISIBILITY_ID_TO_NAME_MAP.items()
- ],
+ choices=list(UserProfile.EMAIL_ADDRESS_VISIBILITY_ID_TO_NAME_MAP.items()),
)
def __init__(self, *args: Any, **kwargs: Any) -> None:
@@ -209,10 +206,7 @@ class ToSForm(forms.Form):
required=False,
coerce=int,
empty_value=None,
- choices=[
- (value, name)
- for value, name in UserProfile.EMAIL_ADDRESS_VISIBILITY_ID_TO_NAME_MAP.items()
- ],
+ choices=list(UserProfile.EMAIL_ADDRESS_VISIBILITY_ID_TO_NAME_MAP.items()),
)
def __init__(self, *args: Any, **kwargs: Any) -> None: