ruff: Fix PLC0208 Use a sequence type when iterating over values.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2023-06-06 13:54:42 -07:00
parent b907ad0dcb
commit b7909db987
4 changed files with 5 additions and 5 deletions

View File

@ -25,7 +25,7 @@ class Command(ZulipBaseCommand):
user_profiles = self.get_users(options, realm)
stream_names = {stream.strip() for stream in options["streams"].split(",")}
for stream_name in set(stream_names):
for stream_name in stream_names:
for user_profile in user_profiles:
stream = ensure_stream(realm, stream_name, acting_user=None)
_ignore, already_subscribed = bulk_add_subscriptions(

View File

@ -40,7 +40,7 @@ Create default stream groups which the users can choose during sign up.
streams = []
stream_names = {stream.strip() for stream in options["streams"].split(",")}
for stream_name in set(stream_names):
for stream_name in stream_names:
stream = ensure_stream(realm, stream_name, acting_user=None)
streams.append(stream)

View File

@ -1588,7 +1588,7 @@ class SocialAuthBase(DesktopFlowTestingLib, ZulipTestCase, ABC):
stream_names = ["new_stream_1", "new_stream_2"]
streams = []
for stream_name in set(stream_names):
for stream_name in stream_names:
stream = ensure_stream(realm, stream_name, acting_user=None)
streams.append(stream)
@ -4599,7 +4599,7 @@ class GoogleAuthBackendTest(SocialAuthBase):
stream_names = ["new_stream_1", "new_stream_2"]
streams = []
for stream_name in set(stream_names):
for stream_name in stream_names:
stream = ensure_stream(realm, stream_name, acting_user=None)
streams.append(stream)

View File

@ -867,7 +867,7 @@ class ZulipLDAPAuthBackendBase(ZulipAuthMixin, LDAPBackend):
if "full_name" in settings.AUTH_LDAP_USER_ATTR_MAP:
full_name_attr = settings.AUTH_LDAP_USER_ATTR_MAP["full_name"]
full_name = ldap_user.attrs[full_name_attr][0]
elif all(key in settings.AUTH_LDAP_USER_ATTR_MAP for key in {"first_name", "last_name"}):
elif all(key in settings.AUTH_LDAP_USER_ATTR_MAP for key in ["first_name", "last_name"]):
first_name_attr = settings.AUTH_LDAP_USER_ATTR_MAP["first_name"]
last_name_attr = settings.AUTH_LDAP_USER_ATTR_MAP["last_name"]
first_name = ldap_user.attrs[first_name_attr][0]