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

Update automatons to fix a bug calling Msg.reject

parent 70adb82b
...@@ -58,7 +58,7 @@ class Articles(Automaton): ...@@ -58,7 +58,7 @@ class Articles(Automaton):
stype = record.subtype() stype = record.subtype()
if stype != "article": if stype != "article":
self.logs[-1].reject(MSG_IS.format(stype), record) self.logs[-1].reject(MSG_IS.format(stype), record=record)
return False return False
try: try:
......
...@@ -184,12 +184,12 @@ class Automaton(object): ...@@ -184,12 +184,12 @@ class Automaton(object):
if isinstance(msg, list): if isinstance(msg, list):
msg = "%s %s" % (msg[0], msg[-1]) msg = "%s %s" % (msg[0], msg[-1])
self.logs[-1].reject(msg, log_year) self.logs[-1].reject(msg, year=log_year)
return 0 return 0
# operation can be rejected by the database # operation can be rejected by the database
except Exception as dbe: except Exception as dbe:
self.logs[-1].reject(str(dbe), log_year) self.logs[-1].reject(str(dbe), year=log_year)
return 0 return 0
def _is_record_in_db(self, def _is_record_in_db(self,
......
...@@ -37,7 +37,7 @@ class Notes(Automaton): ...@@ -37,7 +37,7 @@ class Notes(Automaton):
stype = record.subtype() stype = record.subtype()
if stype != "note": if stype != "note":
self.logs[-1].reject(MSG_IS.format(stype), record) self.logs[-1].reject(MSG_IS.format(stype), record=record)
return False return False
try: try:
......
...@@ -45,7 +45,7 @@ class Preprints(Automaton): ...@@ -45,7 +45,7 @@ class Preprints(Automaton):
stype = record.subtype() stype = record.subtype()
if stype != "preprint": if stype != "preprint":
self.logs[-1].reject(MSG_IS.format(stype), record) self.logs[-1].reject(MSG_IS.format(stype), record=record)
return False return False
if record.is_published(): if record.is_published():
......
...@@ -43,7 +43,7 @@ class Proceedings(Automaton): ...@@ -43,7 +43,7 @@ class Proceedings(Automaton):
stype = record.subtype() stype = record.subtype()
if stype != "proceeding": if stype != "proceeding":
self.logs[-1].reject(MSG_IS.format(stype), record) self.logs[-1].reject(MSG_IS.format(stype), record=record)
return False return False
try: try:
......
...@@ -40,7 +40,7 @@ class Talks(Automaton): ...@@ -40,7 +40,7 @@ class Talks(Automaton):
self.logger.debug(f"{T4}check and fix record (talk)") self.logger.debug(f"{T4}check and fix record (talk)")
if not isinstance(record, (RecordCdsConfPaper, RecordHepConfPaper)): if not isinstance(record, (RecordCdsConfPaper, RecordHepConfPaper)):
self.logs[-1].reject(MSG_NOT_TALK, record) self.logs[-1].reject(MSG_NOT_TALK, record=record)
return False return False
try: try:
......
...@@ -33,7 +33,7 @@ class Thesis(Automaton): ...@@ -33,7 +33,7 @@ class Thesis(Automaton):
stype = record.subtype() stype = record.subtype()
if stype != "thesis": if stype != "thesis":
self.logs[-1].reject(MSG_IS.format(stype), record) self.logs[-1].reject(MSG_IS.format(stype), record=record)
return False return False
try: try:
......
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