Skip to content
Snippets Groups Projects
Commit def01d47 authored by Patrick Jentsch's avatar Patrick Jentsch
Browse files

Add UTC flag to date strings

parent 0a9bea07
No related branches found
No related tags found
No related merge requests found
...@@ -115,9 +115,9 @@ def corpus_analysis_get_meta_data(corpus_id): ...@@ -115,9 +115,9 @@ def corpus_analysis_get_meta_data(corpus_id):
metadata = {} metadata = {}
metadata['corpus_name'] = db_corpus.title metadata['corpus_name'] = db_corpus.title
metadata['corpus_description'] = db_corpus.description metadata['corpus_description'] = db_corpus.description
metadata['corpus_creation_date'] = db_corpus.creation_date.isoformat() metadata['corpus_creation_date'] = db_corpus.creation_date.isoformat() + 'Z'
metadata['corpus_last_edited_date'] = \ metadata['corpus_last_edited_date'] = \
db_corpus.last_edited_date.isoformat() db_corpus.last_edited_date.isoformat() + 'Z'
client = corpus_analysis_clients.get(request.sid) client = corpus_analysis_clients.get(request.sid)
if client is None: if client is None:
response = {'code': 424, 'desc': None, 'msg': 'Failed Dependency'} response = {'code': 424, 'desc': None, 'msg': 'Failed Dependency'}
...@@ -145,7 +145,7 @@ def corpus_analysis_get_meta_data(corpus_id): ...@@ -145,7 +145,7 @@ def corpus_analysis_get_meta_data(corpus_id):
for struct_attr in struct_attrs: for struct_attr in struct_attrs:
texts_metadata[text_id][struct_attr.attrs['name'][(len(text_attr.attrs['name']) + 1):]] = struct_attr.values_by_ids(list(range(struct_attr.attrs['size'])))[text_id] # noqa texts_metadata[text_id][struct_attr.attrs['name'][(len(text_attr.attrs['name']) + 1):]] = struct_attr.values_by_ids(list(range(struct_attr.attrs['size'])))[text_id] # noqa
metadata['corpus_all_texts'] = texts_metadata metadata['corpus_all_texts'] = texts_metadata
metadata['corpus_analysis_date'] = datetime.utcnow().isoformat() metadata['corpus_analysis_date'] = datetime.utcnow().isoformat() + 'Z'
metadata['corpus_cqi_py_protocol_version'] = client.api.version metadata['corpus_cqi_py_protocol_version'] = client.api.version
metadata['corpus_cqi_py_package_version'] = cqi.__version__ metadata['corpus_cqi_py_package_version'] = cqi.__version__
# TODO: make this dynamically # TODO: make this dynamically
......
...@@ -59,7 +59,7 @@ def ressource_after_update_handler(mapper, connection, ressource): ...@@ -59,7 +59,7 @@ def ressource_after_update_handler(mapper, connection, ressource):
# In order to be JSON serializable, DateTime attributes must be # In order to be JSON serializable, DateTime attributes must be
# converted to a string # converted to a string
if isinstance(new_value, datetime): if isinstance(new_value, datetime):
new_value = new_value.isoformat() new_value = new_value.isoformat() + 'Z'
jsonpatch.append( jsonpatch.append(
{ {
'op': 'replace', 'op': 'replace',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment