Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
limbra
limbra
Commits
dcc4ac0e
Commit
dcc4ac0e
authored
Sep 22, 2016
by
LE GAC Renaud
Browse files
Update wizards/affiliation_institute to add protection.
parent
eff54151
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
controllers/wizards.py
controllers/wizards.py
+3
-4
No files found.
controllers/wizards.py
View file @
dcc4ac0e
...
...
@@ -50,14 +50,13 @@ def affiliation_institute():
# extract keys defining the affiliation
# u and v are the main keys use in inspirehep and cds
# b is uses by some note in Atlas
key_1
=
dict
(
key_u
=
record
[
u
"110"
][
"u"
],
key_v
=
""
)
key_2
=
dict
(
key_u
=
record
[
u
"110"
][
"t"
],
key_v
=
""
)
key_3
=
dict
(
key_u
=
record
[
u
"110"
][
"b"
],
key_v
=
""
)
keys
=
(
record
[
u
"110"
][
k
]
for
k
in
(
"u"
,
"t"
,
"b"
)
if
k
in
record
[
u
"110"
])
keys
=
(
dict
(
key_u
=
key
,
key_v
=
""
)
for
key
in
keys
)
# check that the rules does not exist
# load new rules
is_key_add
=
False
for
key
in
(
key
_1
,
key_2
,
key_3
)
:
for
key
in
key
s
:
if
get_id
(
db
.
affiliation_keys
,
**
key
)
is
None
:
db
.
affiliation_keys
[
0
]
=
key
is_key_add
=
True
...
...
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