From 744ae82933a7e4d34582ffccfd963d24dbbf1308 Mon Sep 17 00:00:00 2001 From: springstan <46536646+springstan@users.noreply.github.com> Date: Mon, 3 Feb 2020 05:28:52 +0100 Subject: [PATCH] Replace cmp option with eq and order (#31423) --- homeassistant/auth/models.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/homeassistant/auth/models.py b/homeassistant/auth/models.py index 08f2f375b41..8b4e6355700 100644 --- a/homeassistant/auth/models.py +++ b/homeassistant/auth/models.py @@ -31,22 +31,28 @@ class User: """A user.""" name = attr.ib(type=Optional[str]) - perm_lookup = attr.ib(type=perm_mdl.PermissionLookup, cmp=False) + perm_lookup = attr.ib(type=perm_mdl.PermissionLookup, eq=False, order=False) id = attr.ib(type=str, factory=lambda: uuid.uuid4().hex) is_owner = attr.ib(type=bool, default=False) is_active = attr.ib(type=bool, default=False) system_generated = attr.ib(type=bool, default=False) - groups = attr.ib(type=List[Group], factory=list, cmp=False) + groups = attr.ib(type=List[Group], factory=list, eq=False, order=False) # List of credentials of a user. - credentials = attr.ib(type=List["Credentials"], factory=list, cmp=False) + credentials = attr.ib(type=List["Credentials"], factory=list, eq=False, order=False) # Tokens associated with a user. - refresh_tokens = attr.ib(type=Dict[str, "RefreshToken"], factory=dict, cmp=False) + refresh_tokens = attr.ib( + type=Dict[str, "RefreshToken"], factory=dict, eq=False, order=False + ) _permissions = attr.ib( - type=Optional[perm_mdl.PolicyPermissions], init=False, cmp=False, default=None + type=Optional[perm_mdl.PolicyPermissions], + init=False, + eq=False, + order=False, + default=None, ) @property