diff --git a/src/viralhostrange/viralhostrangedb/tests/test_views.py b/src/viralhostrange/viralhostrangedb/tests/test_views.py index 8496a6b3aac133a103d7263215a780cf25c13cbb..91b15fb24fc724db7099d08c618df0e73764d974 100644 --- a/src/viralhostrange/viralhostrangedb/tests/test_views.py +++ b/src/viralhostrange/viralhostrangedb/tests/test_views.py @@ -821,7 +821,7 @@ class DataSourceCreateViewTestCase(ViewTestCase): self.assertRedirects( response_4, - expected_url=reverse('viralhostrangedb:data-source-detail', args=[new_pk]) + expected_url=reverse('viralhostrangedb:data-source-mapping-edit', args=[new_pk]) ) def test_creation_with_a_live(self): diff --git a/src/viralhostrange/viralhostrangedb/views.py b/src/viralhostrange/viralhostrangedb/views.py index fefca3720447c1898f951751497ea847b2428a8d..98793b3e2c36256ca4e8e642a561b7ba39b7dd55 100644 --- a/src/viralhostrange/viralhostrangedb/views.py +++ b/src/viralhostrange/viralhostrangedb/views.py @@ -1015,6 +1015,21 @@ class DataSourceWizard(wizard_views.NamedUrlSessionWizardView): form_dict["Information"].save() if self.upload_data(): form_dict["Upload"].save(importation_observer=MessageImportationObserver(request=self.request)) + + url = reverse("viralhostrangedb:data-source-mapping-edit", args=[self.instance.pk]) + messages.success( + request=self.request, + message=mark_safe(_( + """Successfully imported data source """ + """<a href="%(url_data_source_name)s" target="_blank"><b>%(data_source_name)s</b></a>.""" + """Redirecting to <a href="%(url)s">%(url)s</a> to map the responses to the global scheme.""" + ) % dict( + data_source_name=self.instance.name, + url_data_source_name=self.instance.get_absolute_url(), + url=url, + )), + ) + return HttpResponseRedirect(url) else: self.instance.save() form_dict["LiveInput"].save(data_source=self.instance)