Skip to content

Commit

Permalink
Moved CONFIG import so it does not get triggered when just importing …
Browse files Browse the repository at this point in the history
…BaseResourceMapper (#569)
  • Loading branch information
ml-evs committed Nov 2, 2020
1 parent 93a190a commit e7a8de9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion optimade/server/mappers/entries.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from typing import Tuple, Optional
from optimade.server.config import CONFIG

__all__ = ("BaseResourceMapper",)

Expand Down Expand Up @@ -45,6 +44,8 @@ def all_aliases(cls) -> Tuple[Tuple[str, str]]:
A tuple of alias tuples.
"""
from optimade.server.config import CONFIG

return (
tuple(
(f"_{CONFIG.provider.prefix}_{field}", field)
Expand All @@ -67,6 +68,8 @@ def all_length_aliases(cls) -> Tuple[Tuple[str, str]]:
A tuple of length alias tuples.
"""
from optimade.server.config import CONFIG

return cls.LENGTH_ALIASES + tuple(
CONFIG.length_aliases.get(cls.ENDPOINT, {}).items()
)
Expand Down

0 comments on commit e7a8de9

Please sign in to comment.