Commit 39010d05 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Fixed bug with provanance check. Adopted exiting parser to nitrogen version of exiting.

parent c80335ec
Subproject commit 3028201afe3f5b839afe3212769f193c9f634069
Subproject commit a2d395a391109a14a76345c9c0cc89fd7f89253d
......@@ -23,7 +23,7 @@ from elasticsearch_dsl import Q
from elasticsearch.exceptions import NotFoundError
import datetime
from nomad import search
from nomad import search, config
from .app import api, rfc3339DateTime
from .auth import login_if_available
......@@ -208,8 +208,9 @@ class RepoCalcsResource(Resource):
else:
abort(400, message='Invalid owner value. Valid values are all|user|staging, default is all')
with_provernance = not Q('term', **{'uploader.user_id': 1})
q = q & with_provernance if q is not None else with_provernance
if config.services.migrated:
with_provernance = ~Q('term', **{'uploader.user_id': 1}) # pylint: disable=invalid-unary-operand-type
q = q & with_provernance if q is not None else with_provernance
data = dict(**request.args)
data.pop('owner', None)
......
......@@ -123,7 +123,9 @@ services = NomadConfig(
disable_reset=True,
not_processed_value='not processed',
unavailable_value='unavailable',
https=False
https=False,
migrated=False # with migrated data will not show data of user 1 in search results,
# since this user was used for data with unknown provenance
)
tests = NomadConfig(
......
......@@ -27,6 +27,7 @@ data:
admin_password: "{{ .Values.api.adminPassword }}"
disable_reset: {{ .Values.api.disableReset }}
https: {{ .Values.api.https }}
migrated: {{ .Values.api.migrated }}
rabbitmq:
host: "{{ .Release.Name }}-rabbitmq"
elastic:
......
......@@ -39,6 +39,8 @@ api:
adminPassword: "password"
## Disable the dangerous reset (delete all data) function
disableReset: "true"
## Do not show data of user with id 1, since he was used for data with unknown provernance
migrated: "false"
## Everthing concerning the nomad worker
worker:
......
......@@ -6,6 +6,7 @@ proxy:
api:
disableReset: false
migrated: true
worker:
replicas: 3
......
This diff is collapsed.
This diff is collapsed.
......@@ -30,6 +30,8 @@ parser_examples = [
('parsers/template', 'tests/data/parsers/template.json'),
('parsers/exciting', 'tests/data/parsers/exciting/Ag/INFO.OUT'),
('parsers/exciting', 'tests/data/parsers/exciting/GW/INFO.OUT'),
('parsers/exciting', 'tests/data/parsers/exciting/nitrogen/INFO.OUT_nitrogen'),
('parsers/exciting', 'tests/data/parsers/exciting/nitrogen/INFO.OUT_carbon'),
('parsers/vasp', 'tests/data/parsers/vasp/vasp.xml'),
('parsers/vasp', 'tests/data/parsers/vasp_compressed/vasp.xml.gz'),
('parsers/vaspoutcar', 'tests/data/parsers/vasp_outcar/OUTCAR'),
......@@ -70,7 +72,7 @@ for parser, mainfile in parser_examples:
parser_examples = fixed_parser_examples
correct_num_output_files = 39
correct_num_output_files = 41
class TestLocalBackend(object):
......
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