Skip to content

Commit

Permalink
Merge pull request #304 from EGA-archive/develop
Browse files Browse the repository at this point in the history
adding scope default
  • Loading branch information
costero-e authored Apr 2, 2024
2 parents 6e31bec + f6821a9 commit 1e5f142
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions beacon/db/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,11 @@ def apply_ontology_filter(query: dict, filter: OntologyFilter, collection: str,
if synonym_id is not None:
filter.id=synonym_id

try:
scope = filter.scope
except Exception:

scope = filter.scope
if scope is None:
scope = collection[0:-1]

is_filter_id_required = True
# Search similar
if filter.similarity != Similarity.EXACT:
Expand Down Expand Up @@ -631,9 +632,8 @@ def format_operator(operator: Operator) -> str:

def apply_alphanumeric_filter(query: dict, filter: AlphanumericFilter, collection: str) -> dict:
#LOG.debug(filter.value)
try:
scope = filter.scope
except Exception:
scope = filter.scope
if scope is None:
scope = collection[0:-1]
formatted_value = format_value(filter.value)
formatted_operator = format_operator(filter.operator)
Expand Down Expand Up @@ -793,9 +793,8 @@ def apply_alphanumeric_filter(query: dict, filter: AlphanumericFilter, collectio
def apply_custom_filter(query: dict, filter: CustomFilter, collection:str) -> dict:
#LOG.debug(query)

try:
scope = filter.scope
except Exception:
scope = filter.scope
if scope is None:
scope = collection[0:-1]
value_splitted = filter.id.split(':')
if value_splitted[0] in conf.alphanumeric_terms:
Expand Down

0 comments on commit 1e5f142

Please sign in to comment.