Skip to content

Commit

Permalink
Fix linted code issues
Browse files Browse the repository at this point in the history
  • Loading branch information
filippomc committed Sep 18, 2024
1 parent a464277 commit cc6af47
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
8 changes: 4 additions & 4 deletions applications/portal/api/templates/main.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ app.add_middleware(
allow_headers=["*"],
)

from cloudharness.middleware import set_authentication_token, get_authentication_token
from cloudharness.middleware import set_authentication_token, get_authentication_token # noqa E402

@app.middleware("http")
async def add_process_time_header(request: Request, call_next):
Expand All @@ -67,8 +67,8 @@ async def add_process_time_header(request: Request, call_next):
if os.environ.get('KUBERNETES_SERVICE_HOST', None):
# init the auth service when running in/for k8s
import threading
from cloudharness_django.services import get_auth_service, init_services
from cloudharness import log
from cloudharness_django.services import get_auth_service, init_services # noqa E402
from cloudharness import log # noqa E402
import time
def start_auth_service():
try:
Expand Down Expand Up @@ -146,6 +146,6 @@ app.mount("/", get_asgi_application())
# import uvicorn
# uvicorn.run(app, host="0.0.0.0", port=8000)

from api.helpers import init_sentry
from api.helpers import init_sentry # noqa E402

init_sentry()
13 changes: 7 additions & 6 deletions applications/portal/backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
# timestamp: 2024-05-15T15:25:40+00:00

from __future__ import annotations
from api.helpers import init_sentry
from cloudharness.middleware import get_authentication_token, set_authentication_token
from cloudharness.auth import decode_token
from api.controllers import *

import os
from datetime import datetime
Expand Down Expand Up @@ -35,6 +31,8 @@
# migrate the Django models
os.system("python manage.py migrate")

from api.controllers import *
from cloudharness.auth import decode_token

app = FastAPI(
title="SciCrunch Antibody Registry API",
Expand All @@ -55,6 +53,8 @@
allow_headers=["*"],
)

from cloudharness.middleware import get_authentication_token, set_authentication_token # noqa: E402


@app.middleware("http")
async def add_process_time_header(request: Request, call_next):
Expand All @@ -75,8 +75,8 @@ async def add_process_time_header(request: Request, call_next):
import threading
import time

from cloudharness import log
from cloudharness_django.services import get_auth_service, init_services
from cloudharness import log # noqa: E402
from cloudharness_django.services import get_auth_service, init_services # noqa: E402

def start_auth_service():
try:
Expand Down Expand Up @@ -318,5 +318,6 @@ def ready() -> str:
# import uvicorn
# uvicorn.run(app, host="0.0.0.0", port=8000)

from api.helpers import init_sentry # noqa: E402

init_sentry()

0 comments on commit cc6af47

Please sign in to comment.