Commit 48bb6e18 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Update wizards.compare_publications to add protections

parent 003f4446
......@@ -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]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment