Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
greg
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
it-bott-integrasjoner
greg
Commits
88114c34
Commit
88114c34
authored
3 years ago
by
Deaktivert bruker
Browse files
Options
Downloads
Patches
Plain Diff
greg.admin, greg.api: fix static analysis problems
Fixes: GREG-13
parent
8da7ce8a
No related branches found
No related tags found
1 merge request
!4
Fix Mypy static analysis problems
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
greg/admin.py
+1
-1
1 addition, 1 deletion
greg/admin.py
greg/api/views/health.py
+10
-5
10 additions, 5 deletions
greg/api/views/health.py
with
11 additions
and
6 deletions
greg/admin.py
+
1
−
1
View file @
88114c34
...
@@ -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
):
...
...
This diff is collapsed.
Click to expand it.
greg/api/views/health.py
+
10
−
5
View file @
88114c34
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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment