Commit edb1c77b authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Fixed external_id handling.

parent 9be8ecce
Pipeline #60819 failed with stages
in 19 minutes and 20 seconds
......@@ -98,6 +98,11 @@ def handle(error: Exception):
response = jsonify(data)
response.status_code = status_code
if status_code == 500:
# the logger is created in before_request, if the error was created before that
# logger can be None
if logger is None:
logger = nomad_utils.get_logger(__name__)
logger.error('internal server error', exc_info=error)
return response
......
......@@ -23,4 +23,4 @@ api = Api(
version='1.0', title='NOMAD API',
description='Official NOMAD API',
validate=True)
""" Provides the flask restplust api instance for the regular NOMAD api"""
""" Provides the flask restplus api instance for the regular NOMAD api"""
......@@ -147,6 +147,7 @@ class CalcWithMetadata():
self.datasets = [
utils.POPO(id=int(ds['id']), doi=utils.POPO(value=ds.get('_doi')), name=ds.get('_name'))
for ds in metadata.get('datasets', [])]
self.external_id = metadata.get('external_id')
def apply_domain_metadata(self, backend):
raise NotImplementedError()
......
......@@ -1051,7 +1051,7 @@ class Upload(Proc):
compressed_calc: Dict[str, Any] = {}
calculations.append(compressed_calc)
for key, value in calc.items():
if key in ['_pid', 'mainfile']:
if key in ['_pid', 'mainfile', 'external_id']:
# these quantities are explicitly calc specific and have to stay with
# the calc
compressed_calc[key] = value
......
......@@ -68,7 +68,7 @@ content-type: application/json
###
# Search migration unpublished calcs
GET http://localhost:19200/fairdi_nomad_prod/_search HTTP/1.1
GET http://localhost:19200/fairdi_nomad_mp/_search HTTP/1.1
Content-Type: application/json
{
......@@ -76,7 +76,7 @@ Content-Type: application/json
"query": {
"bool": {
"must": [
{ "match": { "code_name": "DL_POLY" } }
{ "match": { "code_name": "VASP" } }
]
}
},
......
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