mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-21 07:51:13 -05:00
Removed the check for active user when adding a user to an organisation
This commit is contained in:
@@ -62,7 +62,7 @@ def dao_get_users_for_organisation(organisation_id):
|
||||
@transactional
|
||||
def dao_add_user_to_organisation(organisation_id, user_id):
|
||||
organisation = dao_get_organisation_by_id(organisation_id)
|
||||
user = User.query.filter_by(id=user_id).filter_by(state='active').one()
|
||||
user = User.query.filter_by(id=user_id).one()
|
||||
organisation.users.append(user)
|
||||
db.session.add(organisation)
|
||||
return user
|
||||
|
||||
@@ -171,9 +171,3 @@ def test_add_user_to_organisation_when_user_does_not_exist(sample_organisation):
|
||||
def test_add_user_to_organisation_when_organisation_does_not_exist(sample_user):
|
||||
with pytest.raises(expected_exception=SQLAlchemyError):
|
||||
dao_add_user_to_organisation(organisation_id=uuid.uuid4(), user_id=sample_user.id)
|
||||
|
||||
|
||||
def test_add_user_to_organisation_raises_exception_when_user_is_not_active(sample_organisation):
|
||||
first = create_user(state='inactive')
|
||||
with pytest.raises(expected_exception=SQLAlchemyError):
|
||||
dao_add_user_to_organisation(organisation_id=sample_organisation.id, user_id=first.id)
|
||||
|
||||
Reference in New Issue
Block a user