Commit 12eff491 authored by Dimitri Podborski's avatar Dimitri Podborski
Browse files

bugfix close #194

parent ba7b5659
......@@ -67,7 +67,8 @@ class DocumentFormatter:
# Set the text of all the cells
table.rows[0].cells[0].text = 'Authors'
table.rows[0].cells[1].text = details['authors_string']
if details['authors_string'] is not None:
table.rows[0].cells[1].text = details['authors_string']
table.rows[0].cells[1].paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.LEFT
table.rows[1].cells[0].text = 'Abstract'
if details['abstract'] is not None:
......@@ -199,6 +200,8 @@ def get_issue_metadata(description):
pos2 = description.find(')', pos1 + len(pattern))
meta_str = description[pos1+len(pattern):pos2]
meta = meta_str.split(',')
if len(meta) != 4:
return None
return {'mdms_id': meta[0], 'document': meta[1], 'title': meta[2], 'version': meta[3]}
def create_issue_metadata(document, details):
......@@ -209,7 +212,8 @@ def create_issue_metadata(document, details):
if len(details['documents']) > 0:
last_doc = max(details['documents'], key=lambda x:x['version'])
version = str(last_doc['version'])
meta = '[meta]: # ({},{},{},{})'.format(document['mdms_id'], document['document'], document['title'], version)
title = document['title'].replace('(', '').replace(')', '')
meta = '[meta]: # ({},{},{},{})'.format(document['mdms_id'], document['document'], title, version)
return meta
def create_issue_description_header(document, details):
......
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