fix: tests

pull/19482/head
crazywoola 1 year ago
parent dda6292486
commit c3f4721c24

@ -822,6 +822,9 @@ class TenantService:
db.session.query(TenantAccountJoin).filter_by(tenant_id=tenant.id, account_id=member.id).first() db.session.query(TenantAccountJoin).filter_by(tenant_id=tenant.id, account_id=member.id).first()
) )
if not target_member_join:
raise MemberNotInTenantError("Member not in tenant.")
if target_member_join.role == new_role: if target_member_join.role == new_role:
raise RoleAlreadyAssignedError("The provided role is already assigned to the member.") raise RoleAlreadyAssignedError("The provided role is already assigned to the member.")
@ -830,6 +833,7 @@ class TenantService:
current_owner_join = ( current_owner_join = (
db.session.query(TenantAccountJoin).filter_by(tenant_id=tenant.id, role="owner").first() db.session.query(TenantAccountJoin).filter_by(tenant_id=tenant.id, role="owner").first()
) )
if current_owner_join:
current_owner_join.role = "admin" current_owner_join.role = "admin"
# Update the role of the target member # Update the role of the target member

Loading…
Cancel
Save