Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
hub
ViralHostRangeDB
Commits
ec2baaaf
Commit
ec2baaaf
authored
Sep 30, 2019
by
Bryan BRANCOTTE
Browse files
Redirecting to mapping-edition when creating a new data source with a file
parent
130a626f
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/viralhostrange/viralhostrangedb/tests/test_views.py
View file @
ec2baaaf
...
...
@@ -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
):
...
...
src/viralhostrange/viralhostrangedb/views.py
View file @
ec2baaaf
...
...
@@ -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
)
...
...
Bryan BRANCOTTE
@bbrancot
mentioned in issue
#104 (closed)
·
Sep 30, 2019
mentioned in issue
#104 (closed)
mentioned in issue #104
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment