Skip to content

Commit

Permalink
Bugfix: allow follower to be made account admin (fixes #2095) (#2096)
Browse files Browse the repository at this point in the history
Or, why tests are really needed! Too rushed today for that.
  • Loading branch information
jace authored Jul 12, 2024
1 parent 193d966 commit f77f93d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions funnel/views/membership.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,11 @@ def new_member(self) -> ReturnView:
'error_description': _("This user is already an admin"),
'errors': membership_form.errors,
}, 422
with previous_membership.amend_by(current_auth.user) as amendment:
membership_form.populate_obj(amendment)
new_membership = amendment.membership
new_membership = previous_membership.replace(
actor=current_auth.user,
is_owner=membership_form.is_owner.data,
is_admin=True,
)
else:
new_membership = AccountMembership(
account=self.obj, granted_by=current_auth.user, is_admin=True
Expand Down

0 comments on commit f77f93d

Please sign in to comment.