Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Pinar Alper
metadata-tools
Commits
90a37cb2
Commit
90a37cb2
authored
Mar 17, 2021
by
Vilem Ded
Browse files
adding strip() to email and study name
parent
3ab1ee8b
Changes
1
Hide whitespace changes
Inline
Side-by-side
metadata_tools/importxls/dish_xls_exporter.py
View file @
90a37cb2
...
...
@@ -67,7 +67,7 @@ class DishXlsExporter:
logging
.
info
(
'Processing sheet ----> {}'
.
format
(
book
.
sheet_names
()[
idx
]))
if
is_study
(
sheet
):
cohort_dict
=
{
'name'
:
sheet
[
1
,
1
],
cohort_dict
=
{
'name'
:
sheet
[
1
,
1
]
.
strip
()
,
'description'
:
sheet
[
2
,
1
]
+
' '
+
sheet
[
6
,
1
],
'has_ethics_approval'
:
process_yes_no_answer
(
sheet
[
4
,
1
]),
"ethics_approval_notes"
:
sheet
[
5
,
1
],
...
...
@@ -263,31 +263,31 @@ class DishXlsExporter:
dataset_dict
[
"data_declarations"
].
append
(
datadec_dict
)
elif
is_submission
(
sheet
):
dataset_dict
[
"name"
]
=
sheet
[
2
,
1
]
dataset_dict
[
"project"
]
=
sheet
[
5
,
1
]
dataset_dict
[
"name"
]
=
sheet
[
2
,
1
]
.
strip
()
dataset_dict
[
"project"
]
=
sheet
[
5
,
1
]
.
strip
()
dataset_dict
[
"contacts"
].
extend
([{
"first_name"
:
get_names_from_string
(
sheet
[
9
,
1
])[
0
],
"last_name"
:
get_names_from_string
(
sheet
[
9
,
1
])[
1
],
"role"
:
sheet
[
11
,
1
],
"email"
:
sheet
[
10
,
1
],
"email"
:
sheet
[
10
,
1
]
.
strip
()
,
"affiliations"
:
[
self
.
process_institution
(
sheet
[
7
,
1
])]
},
{
"first_name"
:
get_names_from_string
(
sheet
[
12
,
1
])[
0
],
"last_name"
:
get_names_from_string
(
sheet
[
12
,
1
])[
1
],
"role"
:
"Legal_Representative"
,
"email"
:
sheet
[
10
,
1
],
"email"
:
sheet
[
10
,
1
]
.
strip
()
,
"affiliations"
:
[
self
.
process_institution
(
sheet
[
7
,
1
])]
},
{
"first_name"
:
get_names_from_string
(
sheet
[
14
,
1
])[
0
],
"last_name"
:
get_names_from_string
(
sheet
[
14
,
1
])[
1
],
"role"
:
"Data_Protection_Officer"
,
"email"
:
sheet
[
10
,
1
],
"email"
:
sheet
[
10
,
1
]
.
strip
()
,
"affiliations"
:
[
self
.
process_institution
(
sheet
[
7
,
1
])]
}])
if
sheet
[
16
,
1
]
and
sheet
[
18
,
1
]:
dataset_dict
[
"contacts"
].
append
({
"first_name"
:
get_names_from_string
(
sheet
[
14
,
1
])[
0
],
"last_name"
:
get_names_from_string
(
sheet
[
14
,
1
])[
1
],
"role"
:
sheet
[
18
,
1
],
"email"
:
sheet
[
10
,
1
],
"email"
:
sheet
[
10
,
1
]
.
strip
()
,
"affiliations"
:
[
self
.
process_institution
(
sheet
[
7
,
1
])]
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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