Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chenhao Ma
core
Commits
908088c0
Commit
908088c0
authored
7 years ago
by
Harsha Kethineni
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #926 from scitran/download-subject
Code is sent with subject and test doesn't filter out acquisition files
parents
4d963216
4a6142f6
No related branches found
Branches containing commit
Tags
1.0.70
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
api/download.py
+6
-4
6 additions, 4 deletions
api/download.py
test/integration_tests/python/test_download.py
+2
-6
2 additions, 6 deletions
test/integration_tests/python/test_download.py
with
8 additions
and
10 deletions
api/download.py
+
6
−
4
View file @
908088c0
...
...
@@ -139,10 +139,12 @@ class Download(base.RequestHandler):
subject_prefixes
=
{}
for
session
in
session_dict
.
itervalues
():
if
session
.
get
(
'
subject
'
):
code
=
session
[
'
subject
'
].
get
(
'
code
'
,
'
unknown_subject
'
)
# This is bad and we should try to combine these somehow,
# or at least make sure we get all the files
subject_dict
[
code
]
=
session
[
'
subject
'
]
subject
=
session
.
get
(
'
subject
'
,
{
'
code
'
:
'
unknown_subject
'
})
code
=
subject
.
get
(
'
code
'
)
if
code
is
None
:
code
=
'
unknown_subject
'
subject
[
'
code
'
]
=
code
subject_dict
[
code
]
=
subject
for
code
,
subject
in
subject_dict
.
iteritems
():
subject_prefix
=
prefix
+
'
/
'
+
self
.
_path_from_container
(
subject
,
used_subpaths
,
ids_of_paths
,
code
)
...
...
This diff is collapsed.
Click to expand it.
test/integration_tests/python/test_download.py
+
2
−
6
View file @
908088c0
...
...
@@ -37,14 +37,10 @@ def test_download(data_builder, file_form, as_admin, api_db):
r
=
as_admin
.
post
(
'
/download
'
,
json
=
{
'
optional
'
:
False
,
'
filters
'
:
[{
'
tags
'
:
{
'
-
'
:
[
'
minus
'
],
'
+
'
:
[
'
plus
'
]
'
-
'
:
[
'
minus
'
]
}}],
'
nodes
'
:
[
{
'
level
'
:
'
project
'
,
'
_id
'
:
project
},
{
'
level
'
:
'
session
'
,
'
_id
'
:
session
},
{
'
level
'
:
'
acquisition
'
,
'
_id
'
:
acquisition
},
{
'
level
'
:
'
acquisition
'
,
'
_id
'
:
acquisition2
},
{
'
level
'
:
'
project
'
,
'
_id
'
:
project
},
]
})
assert
r
.
ok
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment