diff --git a/app/main/views/organisations.py b/app/main/views/organisations.py index 5a705969e..fb7514261 100644 --- a/app/main/views/organisations.py +++ b/app/main/views/organisations.py @@ -54,8 +54,10 @@ def add_organisation(): form = NewOrganisationForm() if form.validate_on_submit(): - Organisation.create_from_form(form) - return redirect(url_for('.organisations')) + return redirect(url_for( + '.organisation_settings', + org_id=Organisation.create_from_form(form).id, + )) return render_template( 'views/organisations/add-organisation.html', diff --git a/tests/app/main/views/organisations/test_organisation.py b/tests/app/main/views/organisations/test_organisation.py index 79f7a06bb..6ca33206e 100644 --- a/tests/app/main/views/organisations/test_organisation.py +++ b/tests/app/main/views/organisations/test_organisation.py @@ -103,7 +103,8 @@ def test_create_new_organisation( mocker, ): mock_create_organisation = mocker.patch( - 'app.organisations_client.create_organisation' + 'app.organisations_client.create_organisation', + return_value=organisation_json(ORGANISATION_ID), ) client_request.login(platform_admin_user) @@ -113,7 +114,12 @@ def test_create_new_organisation( 'name': 'new name', 'organisation_type': 'local', 'crown_status': 'non-crown', - } + }, + _expected_redirect=url_for( + 'main.organisation_settings', + org_id=ORGANISATION_ID, + _external=True, + ), ) mock_create_organisation.assert_called_once_with(