Skip to content
Snippets Groups Projects
Commit 88114c34 authored by Deaktivert bruker's avatar Deaktivert bruker
Browse files

greg.admin, greg.api: fix static analysis problems

Fixes: GREG-13
parent 8da7ce8a
No related branches found
No related tags found
1 merge request!4Fix Mypy static analysis problems
...@@ -79,7 +79,7 @@ class PersonConsentAdmin(admin.ModelAdmin): ...@@ -79,7 +79,7 @@ class PersonConsentAdmin(admin.ModelAdmin):
def get_consent_name_en(self, obj): def get_consent_name_en(self, obj):
return obj.consent.consent_name_en return obj.consent.consent_name_en
get_consent_name_en.short_description = "Consent name" get_consent_name_en.short_description = "Consent name" # type: ignore
class OrganizationalUnitAdmin(admin.ModelAdmin): class OrganizationalUnitAdmin(admin.ModelAdmin):
......
from typing import (
Sequence,
Type,
)
from django.http import HttpResponse from django.http import HttpResponse
from drf_spectacular.utils import extend_schema from drf_spectacular.utils import extend_schema
from rest_framework.authentication import BaseAuthentication
from rest_framework.permissions import BasePermission
from rest_framework.status import HTTP_200_OK from rest_framework.status import HTTP_200_OK
from rest_framework.views import APIView from rest_framework.views import APIView
...@@ -7,12 +14,10 @@ from rest_framework.views import APIView ...@@ -7,12 +14,10 @@ from rest_framework.views import APIView
class Health(APIView): class Health(APIView):
"""Health checks.""" """Health checks."""
authentication_classes = [] authentication_classes: Sequence[Type[BaseAuthentication]] = []
permission_classes = [] permission_classes: Sequence[Type[BasePermission]] = []
@extend_schema( @extend_schema(responses={200: str})
responses={200: str},
)
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):
"""Always gives a thumbs up by returning `OK` as plain text.""" """Always gives a thumbs up by returning `OK` as plain text."""
return HttpResponse("OK", content_type="text/plain", status=HTTP_200_OK) return HttpResponse("OK", content_type="text/plain", status=HTTP_200_OK)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment