Commit 4d1a3662 authored by Dimitri Podborski's avatar Dimitri Podborski
Browse files

Adjust deadline, skip abstract request

close #199
parent 70dcbd7a
......@@ -12,6 +12,8 @@ from docx.enum.text import WD_ALIGN_PARAGRAPH # pylint: disable=E0611
OPENING_TAG = '[//]: # ( !!! ATTENTION !!! DO NOT MODIFY BEFORE AND AFTER THIS LINE)'
CLOSING_TAG = '[//]: # ( !!! ATTENTION !!! YOU CAN MODIFY AFTER THIS LINE)'
DEADLINE_DAYS = 6 # Number of days to be subtracted from Monday
class DocumentFormatter:
def __init__(self, template_path):
......@@ -106,7 +108,7 @@ def is_document_late(meeting_start, v1_upload_timestamp):
meeting_start and v1_upload_timestamp shall be datetime objects
"""
meeting_start = meeting_start.replace(hour=0, minute=0, second=0) # paranoia
deadline = meeting_start - timedelta(days=4) # End of Wed
deadline = meeting_start - timedelta(days=DEADLINE_DAYS)
diff = deadline - v1_upload_timestamp
if diff.total_seconds() <= 0:
return True
......@@ -253,10 +255,19 @@ def create_issue_description(document, details):
Create the description of the issue: metadata, table, abstract
"""
description = create_issue_description_header(document, details)
description += '\n\n### Abstract\n'
# request abstract only if submitter is known and not 'Secretariat'
request_abstract = True
if details['submitted_by'] is None:
request_abstract = False
elif 'secretariat' in details['submitted_by']['name'].lower().strip():
request_abstract = False
if details['abstract']:
description += '\n\n### Abstract\n'
description += details['abstract']
else:
elif request_abstract:
description += '\n\n### Abstract\n'
description += '* [ ] please **add your abstract here**.\n'
description += '* [ ] please also **add your abstract to MDMS** (this can be used when we create the output ' \
'document).\n '
......
......@@ -52,7 +52,7 @@ def fetch_contributions(table_entries):
document = entry['document']
project = entry['project']
if not document:
print('WARNING: Document not found. Try updating the database (-u) or select another meeting (--meeting).')
print('WARNING: Document not found. Try updating the database (-U) or select another meeting (--meeting).')
continue
url = document['latest_version_url']
if url is None:
......@@ -74,7 +74,7 @@ def print_infos(table_entries):
document = entry['document']
project = entry['project']
if not document:
print('WARNING: Document not found. Try updating the database (-u) or select another meeting (--meeting).')
print('WARNING: Document not found. Try updating the database (-U) or select another meeting (--meeting).')
continue
print('-' * 51 + '\n' + document['document'] + '\n' + '. ' * 25 + '.')
print('MDMS metadata')
......@@ -372,7 +372,7 @@ def parse_cli(docs, project_url, close_flag, gitlab_projects, input_docs):
for doc in docs:
document = helpers.find_document(input_docs, 'm' + doc)
if not document:
print('WARNING: Document "m{}" not found. Try updating the database (-u) or select another meeting ('
print('WARNING: Document "m{}" not found. Try updating the database (-U) or select another meeting ('
'--meeting).'.format(doc))
continue
table_entries.append({
......
Supports Markdown
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