diff options
author | Jonah BrĂ¼chert <jbb@kaidan.im> | 2024-03-29 02:20:41 +0100 |
---|---|---|
committer | Jonah BrĂ¼chert <jbb@kaidan.im> | 2024-03-29 02:23:00 +0100 |
commit | 39230732099298b7f56c60b396949d8c0484e4dc (patch) | |
tree | d2fc00ccd36783183927fcb90b748641ed588e1d /accounts/utils/__init__.py | |
parent | dcad1d5ca832ea05ababa3d38de9a82fc361f2ba (diff) | |
download | web-39230732099298b7f56c60b396949d8c0484e4dc.tar.gz web-39230732099298b7f56c60b396949d8c0484e4dc.tar.bz2 web-39230732099298b7f56c60b396949d8c0484e4dc.zip |
Format project
To allow automatically formatting changes in the future.
Command used: black -l 79 accounts/
Diffstat (limited to 'accounts/utils/__init__.py')
-rw-r--r-- | accounts/utils/__init__.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/accounts/utils/__init__.py b/accounts/utils/__init__.py index da92528..1f79953 100644 --- a/accounts/utils/__init__.py +++ b/accounts/utils/__init__.py @@ -15,8 +15,9 @@ def templated(template: Optional[str] = None): template_name = template if template_name is None: if request.endpoint: - template_name = request.endpoint \ - .replace('.', '/') + '.html' + template_name = ( + request.endpoint.replace(".", "/") + ".html" + ) else: template_name = "error.html" ctx = f(*args, **kwargs) @@ -25,7 +26,9 @@ def templated(template: Optional[str] = None): elif not isinstance(ctx, dict): return ctx return render_template(template_name, **ctx) + return templated__ + return templated_ @@ -35,15 +38,15 @@ class NotRegexp(Regexp): """ def __call__(self, form, field): - if self.regex.match(field.data or ''): + if self.regex.match(field.data or ""): if self.message is None: - self.message: str = field.gettext('Invalid input.') + self.message: str = field.gettext("Invalid input.") raise ValidationError(self.message) def get_backend(path: str, app: Flask): module = path.rsplit(".", 1).pop() - class_name = '%sBackend' % module.title() + class_name = "%sBackend" % module.title() backend_class = getattr(importlib.import_module(path), class_name) return backend_class(app) |