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
48bb6e18
Commit
48bb6e18
authored
Jan 19, 2021
by
LE GAC Renaud
Browse files
Update wizards.compare_publications to add protections
parent
003f4446
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
controllers/wizards.py
controllers/wizards.py
+6
-1
No files found.
controllers/wizards.py
View file @
48bb6e18
...
...
@@ -15,7 +15,8 @@ from plugin_dbui import (CALLBACK_ERRORS,
is_foreign_field
,
JSONEncoder
,
Selector
,
to_fields
)
to_fields
,
UNDEF_ID
)
MODE_DRY_RUN
=
T
(
DRY_RUN
)
MSG_NO_AUTHORS
=
"<br><br>Removing affiliation failed.<br>"
\
...
...
@@ -238,6 +239,10 @@ def compare_publications():
if
is_foreign_field
(
field
):
k_tablename
,
k_fieldname
,
k_id
=
get_foreign_field
(
field
)
# protection against None
value1
=
(
UNDEF_ID
if
value1
is
None
else
value1
)
value2
=
(
UNDEF_ID
if
value2
is
None
else
value2
)
value1
=
db
[
k_tablename
][
value1
][
k_fieldname
]
value2
=
db
[
k_tablename
][
value2
][
k_fieldname
]
...
...
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