Commit 4708a0d2 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Deploy new Msg.reject in automatons.

parent 3254fa10
......@@ -53,7 +53,7 @@ class Articles(Automaton):
self.check.clean_erratum(record)
if not record.is_published():
self.logs[-1].reject(MSG_NO_EDITOR, record.year())
self.logs[-1].reject(MSG_NO_EDITOR, record=record)
return False
self.check.format_editor(record)
......@@ -67,11 +67,11 @@ class Articles(Automaton):
self.check.get_my_authors(record, family_name_fr)
except CheckException as e:
self.logs[-1].reject(e, record.year())
self.logs[-1].reject(e, record=record)
return False
except Exception as e:
self.logs[-1].reject(MSG_CRASH % e, record.year(), translate=False)
self.logs[-1].reject(MSG_CRASH % e, record=record, translate=False)
print traceback.format_exc()
return False
......
......@@ -368,7 +368,7 @@ class Automaton(object):
self.check.collaboration(record)
except Exception as e:
self.logs[-1].reject(e, record.year())
self.logs[-1].reject(e, record=record)
return False
return True
......
......@@ -40,11 +40,11 @@ class Notes(Automaton):
self.check.get_my_authors(record, family_name_fr)
except CheckException as e:
self.logs[-1].reject(e, record.year())
self.logs[-1].reject(e, record=record)
return False
except Exception as e:
self.logs[-1].reject(MSG_CRASH % e, record.year(), translate=False)
self.logs[-1].reject(MSG_CRASH % e, record=record, translate=False)
print traceback.format_exc()
return False
......
......@@ -39,19 +39,19 @@ class Preprints(Automaton):
print "check preprint record"
if record.is_published():
self.logs[-1].reject(MSG_PREPRINT_IS_PAPER, record.year())
self.logs[-1].reject(MSG_PREPRINT_IS_PAPER, record=record)
return False
if isinstance(record, RecordConf):
self.logs[-1].reject(MSG_PREPRINT_IS_CONFERENCE, record.year())
self.logs[-1].reject(MSG_PREPRINT_IS_CONFERENCE, record=record)
return False
if isinstance(record, RecordThesis):
self.logs[-1].reject(MSG_PREPRINT_IS_THESIS, record.year())
self.logs[-1].reject(MSG_PREPRINT_IS_THESIS, record=record)
return False
if not record.preprint_number():
self.logs[-1].reject(MSG_PREPRINT_NO_NUMBER, record.year())
self.logs[-1].reject(MSG_PREPRINT_NO_NUMBER, record=record)
return False
try:
......@@ -62,11 +62,11 @@ class Preprints(Automaton):
self.check.get_my_authors(record, family_name_fr)
except CheckException as e:
self.logs[-1].reject(e, record.year())
self.logs[-1].reject(e, record=record)
return False
except Exception as e:
self.logs[-1].reject(MSG_CRASH % e, record.year(), translate=False)
self.logs[-1].reject(MSG_CRASH % e, record=record, translate=False)
print traceback.format_exc()
return False
......
......@@ -49,11 +49,11 @@ class Proceedings(Automaton):
self.check.get_my_authors(record, family_name_fr)
except CheckException as e:
self.logs[-1].reject(e, record.year())
self.logs[-1].reject(e, record=record)
return False
except Exception as e:
self.logs[-1].reject(MSG_CRASH % e, record.year(), translate=False)
self.logs[-1].reject(MSG_CRASH % e, record=record, translate=False)
print traceback.format_exc()
return False
......
......@@ -36,7 +36,7 @@ class Reports(Automaton):
print "check report record"
if not record.report_number():
self.logs[-1].reject(MSG_REPORT_NO_NUMBER, record.year())
self.logs[-1].reject(MSG_REPORT_NO_NUMBER, record=record)
return False
try:
......@@ -47,11 +47,11 @@ class Reports(Automaton):
self.check.get_my_authors(record, family_name_fr)
except CheckException as e:
self.logs[-1].reject(e, record.year())
self.logs[-1].reject(e, record=record)
return False
except Exception as e:
self.logs[-1].reject(MSG_CRASH % e, record.year(), translate=False)
self.logs[-1].reject(MSG_CRASH % e, record=record, translate=False)
print traceback.format_exc()
return False
......
......@@ -44,11 +44,11 @@ class Talks(Automaton):
self.check.get_my_authors(record, family_name_fr)
except CheckException as e:
self.logs[-1].reject(e, record.year())
self.logs[-1].reject(e, record=record)
return False
except Exception as e:
self.logs[-1].reject(MSG_CRASH % e, record.year(), translate=False)
self.logs[-1].reject(MSG_CRASH % e, record=record, translate=False)
print traceback.format_exc()
return False
......
......@@ -43,11 +43,11 @@ class Thesis(Automaton):
self.check.get_my_authors(record, family_name_fr)
except CheckException as e:
self.logs[-1].reject(e, record.year())
self.logs[-1].reject(e, record=record)
return False
except Exception as e:
self.logs[-1].reject(MSG_CRASH % e, record.year(), translate=False)
self.logs[-1].reject(MSG_CRASH % e, record=record, translate=False)
print traceback.format_exc()
return False
......@@ -57,7 +57,7 @@ class Thesis(Automaton):
if isinstance(record, RecordThesis):
return True
self.logs[-1].reject(MSG_NO_THESIS, record.year())
self.logs[-1].reject(MSG_NO_THESIS, record=record)
return False
def insert_record(self, record):
......
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