Skip to content

Commit

Permalink
Fix type annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
Dosenpfand committed Aug 6, 2023
1 parent 3700f7c commit e05eb74
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging
import sys
from typing import Optional, Union
from typing import NoReturn, Optional, Union

import click
import sentry_sdk
Expand Down Expand Up @@ -49,13 +49,15 @@ def create_app(

# Register
@app.before_request
def check_maintanence():
def check_maintanence() -> Union[None, NoReturn]:
if (
app.config.get("MAINTENANCE")
and request.url_rule
and request.url_rule.endpoint
and (request.url_rule.endpoint not in ["static", "bootstrap.static"])
):
abort(503)
return None

# Instantiate extensions
bootstrap = Bootstrap4()
Expand Down

0 comments on commit e05eb74

Please sign in to comment.