Commit ebf71895 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Bugs fixed.

parent fca13ec7
...@@ -133,21 +133,26 @@ class Automaton(object): ...@@ -133,21 +133,26 @@ class Automaton(object):
try: try:
rec_id = db.publications.insert (**fields) rec_id = db.publications.insert (**fields)
return 1 if rec_id:
return 1
# operation can be rejected by the database # operation can be reject by callbacks table._before_insert
except Exception as dbe: else:
self.logs[-1].reject(dbe.message, year) msg = MSG_NSERT_FAIL
if CALLBACK_ERRORS in db.publications:
msg = db.publications._callback_errors
# operation can be reject by callbacks table._before_insert # reduce the error message
if not rec_id: if isinstance(msg, list):
msg = MSG_NSERT_FAIL msg = "%s %s" % (msg[0], msg[-1])
if CALLBACK_ERRORS in db.publications:
msg = db.publications._callback_errors
self.logs[-1].reject(msg, year) self.logs[-1].reject(msg, log_year)
return 0
return 0 # operation can be rejected by the database
except Exception as dbe:
self.logs[-1].reject(dbe.message, log_year)
return 0
def _is_record_in_db(self, rec_id, title): def _is_record_in_db(self, rec_id, title):
"""Return C{True} if the record is already in the database. """Return C{True} if the record is already in the database.
......
...@@ -625,7 +625,7 @@ class CheckAndFix(object): ...@@ -625,7 +625,7 @@ class CheckAndFix(object):
if not value: if not value:
raise CheckException(MSG_NO_MY_AUTHOR) raise CheckException(MSG_NO_MY_AUTHOR)
record.my_author = value record.my_authors = value
def is_conference(self, record): def is_conference(self, record):
"""Check that the record described a conference talk / proceeding. """Check that the record described a conference talk / proceeding.
......
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