Skip to content

Commit

Permalink
Reverting to __init__ override
Browse files Browse the repository at this point in the history
  • Loading branch information
David Pugh committed Feb 25, 2022
1 parent 4089ca0 commit 279777f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/fastapi_aad_auth/ui/jinja.py
Expand Up @@ -25,9 +25,7 @@ def get_source(environment: Environment, template: str):
class Jinja2Templates(_Jinja2Templates): # noqa: D101
__doc__ = _Jinja2Templates.__doc__

def get_env(self, directory: str) -> Environment:
"""Get the environment."""
env = super().get_env(directory)
# We want to setup the choice loader here
env.loader = ChoiceLoader([PkgResourcesTemplateLoader(), env.loader]) # type: ignore[list-item]
return env
def __init__(self, *args, **kwargs) -> Environment:
"""Initialise the templates and update the environment."""
super().__init__(*args, **kwargs)
self.env.loader = ChoiceLoader([PkgResourcesTemplateLoader(), self.env.loader]) # type: ignore[list-item]

0 comments on commit 279777f

Please sign in to comment.