Skip to content

Commit

Permalink
🎨 [#50] fixed black formating
Browse files Browse the repository at this point in the history
  • Loading branch information
bart-maykin committed Aug 2, 2024
1 parent 90686be commit 674927d
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 15 deletions.
8 changes: 5 additions & 3 deletions src/objects/api/kanalen.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ def __init__(
def get_kenmerken(self, obj: models.Model, data: dict = None) -> dict:
data = data or {}
return {
kenmerk: data.get("type") or obj.object.object_type.url
if kenmerk == "object_type"
else data.get(kenmerk, getattr(obj, kenmerk))
kenmerk: (
data.get("type") or obj.object.object_type.url
if kenmerk == "object_type"
else data.get(kenmerk, getattr(obj, kenmerk))
)
for kenmerk in self.kenmerken
}

Expand Down
12 changes: 6 additions & 6 deletions src/objects/api/v1/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,13 @@ def finalize_response(self, request, response, *args, **kwargs):

if serializer and response.status_code == 200:
if self.action == "retrieve" and serializer.not_allowed:
self.headers[
settings.UNAUTHORIZED_FIELDS_HEADER
] = serializer.not_allowed.pretty()
self.headers[settings.UNAUTHORIZED_FIELDS_HEADER] = (
serializer.not_allowed.pretty()
)

elif self.action in ("list", "search") and serializer.child.not_allowed:
self.headers[
settings.UNAUTHORIZED_FIELDS_HEADER
] = serializer.child.not_allowed.pretty()
self.headers[settings.UNAUTHORIZED_FIELDS_HEADER] = (
serializer.child.not_allowed.pretty()
)

return super().finalize_response(request, response, *args, **kwargs)
12 changes: 6 additions & 6 deletions src/objects/api/v2/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,14 @@ def finalize_response(self, request, response, *args, **kwargs):
response.data.get("results"), "serializer", None
)
if self.action == "retrieve" and serializer.not_allowed:
self.headers[
settings.UNAUTHORIZED_FIELDS_HEADER
] = serializer.not_allowed.pretty()
self.headers[settings.UNAUTHORIZED_FIELDS_HEADER] = (
serializer.not_allowed.pretty()
)

elif self.action in ("list", "search") and serializer.child.not_allowed:
self.headers[
settings.UNAUTHORIZED_FIELDS_HEADER
] = serializer.child.not_allowed.pretty()
self.headers[settings.UNAUTHORIZED_FIELDS_HEADER] = (
serializer.child.not_allowed.pretty()
)

return super().finalize_response(request, response, *args, **kwargs)

Expand Down
1 change: 1 addition & 0 deletions src/objects/conf/ci.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Continuous integration settings module.
"""

import logging
import os

Expand Down
1 change: 1 addition & 0 deletions src/objects/conf/staging.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Staging environment settings module.
This *should* be nearly identical to production.
"""

import os

os.environ.setdefault("ENVIRONMENT", "staging")
Expand Down
1 change: 1 addition & 0 deletions src/objects/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
do NOT import anything Django related here, as this file needs to be loaded
before Django is initialized.
"""

import os

from dotenv import load_dotenv
Expand Down
1 change: 1 addition & 0 deletions src/objects/tests/v1/test_stuf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
material and formal history defined in the StUF 03.01 (Standaard Uitwisseling Formaat)
https://www.gemmaonline.nl/images/gemmaonline/f/fa/Stuf0301.pdf
"""

from datetime import date

from rest_framework import status
Expand Down
1 change: 1 addition & 0 deletions src/objects/tests/v2/test_stuf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
material and formal history defined in the StUF 03.01 (Standaard Uitwisseling Formaat)
https://www.gemmaonline.nl/images/gemmaonline/f/fa/Stuf0301.pdf
"""

from datetime import date

from rest_framework import status
Expand Down
1 change: 1 addition & 0 deletions src/objects/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""

from django.core.wsgi import get_wsgi_application

from objects.setup import setup_env
Expand Down

0 comments on commit 674927d

Please sign in to comment.