#169 Team delete-restore

* adds restorable delete functionality to Team model
* refactors minor code model parts by introducing DeletableObjectMixin
* only non-deleted Teams can be chosen for sharing
* deleted Teams can be restored using the proper function on the backend admin
* deleted Teams do not provide
* adds migration
This commit is contained in:
2022-05-30 15:38:16 +02:00
parent 8aa3fbd97a
commit e7031d0bc2
13 changed files with 111 additions and 35 deletions

View File

@@ -160,3 +160,15 @@ class User(AbstractUser):
else:
token = self.api_token
return token
@property
def shared_teams(self):
""" Wrapper for fetching active teams of this user
Returns:
"""
shared_teams = self.teams.filter(
deleted__isnull=True
)
return shared_teams