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
bfbd3720
Commit
bfbd3720
authored
Feb 03, 2022
by
Bryan BRANCOTTE
Browse files
allows curators to download former version iff they did the change
parent
b4dc2575
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/viralhostrange/viralhostrangedb/views.py
View file @
bfbd3720
...
...
@@ -445,13 +445,17 @@ def get_log_entry_with_permission_check_or_404(request, pk, log_pk, allow_curato
@
login_required
def
data_source_history_download
(
request
,
pk
,
log_pk
):
data_source
,
le
=
get_log_entry_with_permission_check_or_404
(
request
,
pk
,
log_pk
,
allow_curator
=
True
,
user_id
=
request
.
user
.
id
,
)
try
:
data_source
,
le
=
get_log_entry_with_permission_check_or_404
(
request
,
pk
,
log_pk
)
except
Http404
:
# if we cannot get it, then allows curators, but only on their own entry
data_source
,
le
=
get_log_entry_with_permission_check_or_404
(
request
,
pk
,
log_pk
,
allow_curator
=
True
,
user_id
=
request
.
user
.
id
,
)
file_path
=
business_process
.
get_backup_file_path
(
le
,
test_if_exists
=
True
)
if
file_path
is
None
:
...
...
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