Skip to content

Commit

Permalink
CELE-119 style: Apply linting
Browse files Browse the repository at this point in the history
  • Loading branch information
afonsobspinto committed Dec 19, 2024
1 parent f3125ca commit ae68043
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions applications/visualizer/backend/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from .services.connectivity import query_nematode_connections
from .authenticators.basic_auth_super_user import basic_auth_superuser


class ErrorMessage(Schema):
detail: str

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ def authenticate(self, request, username, password):
if user and user.is_superuser: # Ensure the user is a superuser
return user
return None

basic_auth_superuser = BasicAuthSuperUser()


basic_auth_superuser = BasicAuthSuperUser()
2 changes: 2 additions & 0 deletions applications/visualizer/backend/api/decorators/streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
from functools import wraps
from django.http import StreamingHttpResponse


def with_stdout_streaming(func):
"""
A decorator that:
- Runs the decorated function in a separate thread,
- Captures anything it prints to stdout,
- Streams that output asynchronously line-by-line as it's produced.
"""

@wraps(func)
def wrapper(request, *args, **kwargs):
q = Queue()
Expand Down

0 comments on commit ae68043

Please sign in to comment.