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 C418 Unnecessary `dict` literal passed to `dict()`.

Anders Kaseorg5ecff88c1ba7
diff --git a/zerver/lib/scim.py b/zerver/lib/scim.py
index b21125565ec..d06a9166521 100644
--- a/zerver/lib/scim.py
+++ b/zerver/lib/scim.py
@@ -97,24 +97,21 @@ class ZulipSCIMUser(SCIMUser):
"givenName": first_name,
"familyName": last_name,
}
- d = dict(
- {
- "schemas": [scim_constants.SchemaURI.USER],
- "id": self.obj.id,
- "userName": self.obj.delivery_email,
- "name": name,
- "displayName": self.display_name,
- "active": self.obj.is_active,
- # meta is a property implemented in the superclass
- # TODO: The upstream implementation uses `user_profile.date_joined`
- # as the value of the lastModified meta attribute, which is not
- # a correct simplification. We should add proper tracking
- # of this value.
- "meta": self.meta,
- }
- )
- return d
+ return {
+ "schemas": [scim_constants.SchemaURI.USER],
+ "id": self.obj.id,
+ "userName": self.obj.delivery_email,
+ "name": name,
+ "displayName": self.display_name,
+ "active": self.obj.is_active,
+ # meta is a property implemented in the superclass
+ # TODO: The upstream implementation uses `user_profile.date_joined`
+ # as the value of the lastModified meta attribute, which is not
+ # a correct simplification. We should add proper tracking
+ # of this value.
+ "meta": self.meta,
+ }
def from_dict(self, d: Dict[str, Any]) -> None:
"""Consume a dictionary conforming to the SCIM User Schema. The