ruff: Fix SIM118 Use k not in d instead of k not in d.keys().

Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 74d6d76046)
This commit is contained in:
Anders Kaseorg
2023-07-23 12:20:53 -07:00
committed by Alex Vandiver
parent 91e5ef39eb
commit 323223db4c
4 changed files with 7 additions and 7 deletions

View File

@@ -65,9 +65,9 @@ def validate_external_account_field_data(field_data: ProfileFieldData) -> Profil
field_validator("field_data", field_data)
field_subtype = field_data.get("subtype")
if field_subtype not in DEFAULT_EXTERNAL_ACCOUNTS.keys():
if field_subtype not in DEFAULT_EXTERNAL_ACCOUNTS:
if field_subtype == "custom":
if "url_pattern" not in field_data.keys():
if "url_pattern" not in field_data:
raise ValidationError(_("Custom external account must define URL pattern"))
else:
raise ValidationError(_("Invalid external account type"))