def add_or_remove_user(self, *, challenge: Challenge, site): if self.cleaned_data["action"] == AdminsForm.ADD: challenge.add_admin(self.cleaned_data["user"]) send_new_admin_notification_email( challenge=challenge, new_admin=self.cleaned_data["user"], site=site, ) elif self.cleaned_data["action"] == AdminsForm.REMOVE: challenge.remove_admin(self.cleaned_data["user"])
def add_or_remove_user(self, *, challenge: Challenge, site): if self.cleaned_data["action"] == AdminsForm.ADD: challenge.add_admin(self.cleaned_data["user"]) elif self.cleaned_data["action"] == AdminsForm.REMOVE: challenge.remove_admin(self.cleaned_data["user"])