mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-04-14 14:21:58 -04:00
Redirect to new organisation after creation
The thing you want to do after creating an org is probably set some domains or default branding, so let’s take you to the page where you can do that.
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user