#146 Team leave
* 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:
@@ -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="",
|
||||
|
||||
Reference in New Issue
Block a user