Add endpoint to allow org team members to be removed

This is similar to the corresponding endpoint for services. However,
it is a little simpler since we don't need to worry about always having
at least one team member for an organisation.

The new dao function added, `dao_remove_user_from_organisation`, is also
simpler than `dao_remove_user_from_service` since we don't have any
organisation permissions to deal with.
This commit is contained in:
Katie Smith
2022-01-05 13:30:52 +00:00
parent 081e0cab88
commit ed725c1513
3 changed files with 47 additions and 0 deletions

View File

@@ -137,3 +137,8 @@ def dao_add_user_to_organisation(organisation_id, user_id):
user.organisations.append(organisation)
db.session.add(organisation)
return user
@autocommit
def dao_remove_user_from_organisation(organisation, user):
organisation.users.remove(user)