* adds button and functionality for leaving a team
   * if the admin leaves the team, another user will be chosen as new admin automatically
* improves Team (django) admin backend
   * better control over user adding-removing
   * only added team members are selectable as admin
This commit is contained in:
2022-04-13 15:52:41 +02:00
parent bf1c0e2078
commit 87fae51144
8 changed files with 105 additions and 42 deletions
+9
View File
@@ -317,6 +317,15 @@ class RemoveTeamModalForm(RemoveModalForm):
pass
class LeaveTeamModalForm(RemoveModalForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.form_title = _("Leave team")
def save(self):
self.instance.remove_user(self.user)
class TeamDataForm(BaseModalForm):
name = forms.CharField(
label_suffix="",