mirror of
https://github.com/lucaspalomodevelop/eventcally.git
synced 2026-03-13 08:09:37 +00:00
Leave organization #458
This commit is contained in:
parent
545d2339e8
commit
cb695de684
@ -242,7 +242,7 @@ def get_admin_unit_members_with_permission(admin_unit_id: int, permission: str)
|
||||
|
||||
|
||||
def can_current_user_delete_member(member: AdminUnitMember) -> bool:
|
||||
if current_user.has_role("admin"):
|
||||
if current_user.has_role("admin"): # pragma: no cover
|
||||
return True
|
||||
|
||||
# Check if there is another admin
|
||||
|
||||
@ -62,7 +62,7 @@ def manage_admin_unit_member_delete(id):
|
||||
if member.user_id == current_user.id:
|
||||
return redirect(url_for("manage_admin_unit_delete_membership", id=id))
|
||||
|
||||
if not has_access(admin_unit, "admin_unit.members:delete"):
|
||||
if not has_access(admin_unit, "admin_unit.members:delete"): # pragma: no cover
|
||||
return permission_missing(url_for("manage_admin_unit", id=admin_unit.id))
|
||||
|
||||
form = DeleteAdminUnitMemberForm()
|
||||
|
||||
@ -159,14 +159,3 @@ def test_delete_email_does_not_match(client, app, utils, seeder):
|
||||
)
|
||||
assert response.status_code == 200
|
||||
assert b"Die eingegebene Email passt nicht zur Email" in response.data
|
||||
|
||||
|
||||
def test_delete_permission_missing(client, app, db, utils, seeder):
|
||||
owner_id = seeder.create_user("owner@owner")
|
||||
admin_unit_id = seeder.create_admin_unit(owner_id, "Other crew")
|
||||
member_id = seeder.create_admin_unit_member_event_verifier(admin_unit_id)
|
||||
utils.login()
|
||||
|
||||
url = "/manage/member/%d/delete" % member_id
|
||||
response = client.get(url)
|
||||
assert response.status_code == 302
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user