Fix black linting

This commit is contained in:
wvffle 2022-09-25 15:02:21 +00:00 committed by Georg Krause
commit c0b2c8d41e
15 changed files with 92 additions and 79 deletions

View file

@ -86,7 +86,7 @@ class ApplicationViewSet(
qs = qs.filter(user=self.request.user)
return qs
@extend_schema(operation_id='refresh_oauth_token')
@extend_schema(operation_id="refresh_oauth_token")
@action(
detail=True,
methods=["post"],

View file

@ -21,7 +21,7 @@ from funkwhale_api.common import throttling
from . import models, serializers, tasks
@extend_schema(operation_id='register', methods=['post'])
@extend_schema(operation_id="register", methods=["post"])
class RegisterView(registration_views.RegisterView):
serializer_class = serializers.RegisterSerializer
permission_classes = []
@ -46,22 +46,22 @@ class RegisterView(registration_views.RegisterView):
return user
@extend_schema(operation_id='verify_email')
@extend_schema(operation_id="verify_email")
class VerifyEmailView(registration_views.VerifyEmailView):
action = "verify-email"
@extend_schema(operation_id='change_password')
@extend_schema(operation_id="change_password")
class PasswordChangeView(rest_auth_views.PasswordChangeView):
action = "password-change"
@extend_schema(operation_id='reset_password')
@extend_schema(operation_id="reset_password")
class PasswordResetView(rest_auth_views.PasswordResetView):
action = "password-reset"
@extend_schema(operation_id='confirm_password_reset')
@extend_schema(operation_id="confirm_password_reset")
class PasswordResetConfirmView(rest_auth_views.PasswordResetConfirmView):
action = "password-reset-confirm"
@ -73,8 +73,8 @@ class UserViewSet(mixins.UpdateModelMixin, viewsets.GenericViewSet):
lookup_value_regex = r"[a-zA-Z0-9-_.]+"
required_scope = "profile"
@extend_schema(operation_id='get_authenticated_user', methods=['get'])
@extend_schema(operation_id='delete_authenticated_user', methods=['delete'])
@extend_schema(operation_id="get_authenticated_user", methods=["get"])
@extend_schema(operation_id="delete_authenticated_user", methods=["delete"])
@action(methods=["get", "delete"], detail=False)
def me(self, request, *args, **kwargs):
"""Return information about the current user or delete it"""
@ -89,7 +89,7 @@ class UserViewSet(mixins.UpdateModelMixin, viewsets.GenericViewSet):
serializer = serializers.MeSerializer(request.user)
return Response(serializer.data)
@extend_schema(operation_id='update_settings')
@extend_schema(operation_id="update_settings")
@action(methods=["post"], detail=False, url_name="settings", url_path="settings")
def set_settings(self, request, *args, **kwargs):
"""Return information about the current user or delete it"""
@ -121,7 +121,7 @@ class UserViewSet(mixins.UpdateModelMixin, viewsets.GenericViewSet):
data = {"subsonic_api_token": self.request.user.subsonic_api_token}
return Response(data)
@extend_schema(operation_id='change_email')
@extend_schema(operation_id="change_email")
@action(
methods=["post"],
required_scope="security",
@ -149,8 +149,8 @@ class UserViewSet(mixins.UpdateModelMixin, viewsets.GenericViewSet):
return super().partial_update(request, *args, **kwargs)
@extend_schema(operation_id='login')
@action(methods=['post'], detail=False)
@extend_schema(operation_id="login")
@action(methods=["post"], detail=False)
def login(request):
throttling.check_request(request, "login")
if request.method != "POST":
@ -170,8 +170,8 @@ def login(request):
return response
@extend_schema(operation_id='logout')
@action(methods=['post'], detail=False)
@extend_schema(operation_id="logout")
@action(methods=["post"], detail=False)
def logout(request):
if request.method != "POST":
return http.HttpResponse(status=405)