⬆️(dependencies) update python dependencies
Fix new linter issues introduced by Ruff's upgrade.
This commit is contained in:
committed by
aleb_the_flash
parent
ab7d466823
commit
6abcf98ad2
@@ -289,6 +289,12 @@ class Identity(BaseModel):
|
||||
main_str = "[main]" if self.is_main else ""
|
||||
return f"{self.email:s}{main_str:s}"
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
"""Ensure users always have one and only one main identity."""
|
||||
super().save(*args, **kwargs)
|
||||
if self.is_main is True:
|
||||
self.user.identities.exclude(id=self.id).update(is_main=False)
|
||||
|
||||
def clean(self):
|
||||
"""Normalize the email field and clean the 'is_main' field."""
|
||||
if self.email:
|
||||
@@ -302,12 +308,6 @@ class Identity(BaseModel):
|
||||
)
|
||||
super().clean()
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
"""Ensure users always have one and only one main identity."""
|
||||
super().save(*args, **kwargs)
|
||||
if self.is_main is True:
|
||||
self.user.identities.exclude(id=self.id).update(is_main=False)
|
||||
|
||||
|
||||
class Team(BaseModel):
|
||||
"""
|
||||
|
||||
@@ -227,7 +227,7 @@ def test_models_team_access_get_abilities_for_member_of_administrator():
|
||||
|
||||
|
||||
def test_models_team_access_get_abilities_for_member_of_member_user(
|
||||
django_assert_num_queries
|
||||
django_assert_num_queries,
|
||||
):
|
||||
"""Check abilities of member access for the member of a team."""
|
||||
access = factories.TeamAccessFactory(role="member")
|
||||
|
||||
Reference in New Issue
Block a user