Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iric-data
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bioinfo_iric
iric-data
Commits
d5f4d261
Commit
d5f4d261
authored
1 year ago
by
Albert Feghaly
Browse files
Options
Downloads
Patches
Plain Diff
Allow missing fields in payload when uploading
parent
035680da
No related branches found
Branches containing commit
No related tags found
2 merge requests
!111
Populate /secure/my-sharegroups/ with the same groups that are available to a...
,
!110
Resolve "Allow file upload through servlet with no dataset id"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
portal/views/secure/datafile.py
+10
-8
10 additions, 8 deletions
portal/views/secure/datafile.py
with
10 additions
and
8 deletions
portal/views/secure/datafile.py
+
10
−
8
View file @
d5f4d261
...
...
@@ -355,23 +355,25 @@ class DataFileUploadServletView(LoginRequiredMixin, ActivePageViewMixin, CreateV
def
form_valid
(
self
,
form
):
formcd
=
form
.
cleaned_data
uploaded_by
=
self
.
request
.
user
.
profile
if
self
.
request
.
user
.
is_staff
and
form
.
cleaned_data
.
get
(
'
as_user
'
):
uploaded_by
=
form
.
cleaned_data
.
get
(
'
as_user
'
)
if
self
.
request
.
user
.
is_staff
and
form
cd
.
get
(
'
as_user
'
):
uploaded_by
=
form
cd
.
get
(
'
as_user
'
)
file
=
DataFile
(
uploaded_by
=
uploaded_by
,
file
=
self
.
request
.
FILES
[
'
file
'
])
if
form
.
cleaned_data
.
get
(
'
annotations
'
):
file
.
annotations
=
form
.
cleaned_data
[
'
annotations
'
]
if
'
annotations
'
in
formcd
and
formcd
.
get
(
'
annotations
'
):
file
.
annotations
=
form
cd
[
'
annotations
'
]
if
form
.
cleaned_data
.
get
(
'
lab
'
):
file
.
lab
=
form
.
cleaned_data
[
'
lab
'
]
if
'
lab
'
in
formcd
and
formcd
.
get
(
'
lab
'
):
file
.
lab
=
form
cd
[
'
lab
'
]
file
.
save
()
dataset
=
form
.
cleaned_data
.
get
(
'
dataset
'
)
if
dataset
:
if
'
dataset
'
in
form
cd
and
formcd
.
get
(
'
dataset
'
)
:
dataset
=
formcd
.
get
(
'
dataset
'
)
dataset
.
files
.
add
(
file
)
dataset
.
save
()
...
...
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