Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved CONFIG import so it does not get triggered when just importing mapper #569

Merged
merged 2 commits into from
Nov 2, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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