Skip to content

Commit

Permalink
💚 black
Browse files Browse the repository at this point in the history
  • Loading branch information
annashamray committed Feb 5, 2024
1 parent f040a9f commit 22456c2
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 6 deletions.
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
The urls import is needed to make sure all urls/subclasses are registered
BEFORE fixtures run.
"""

from django.urls import clear_script_prefix, set_script_prefix

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/test_content_type_headers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test that the required content type headers are present.
"""

from django.urls import path
from django.utils.translation import gettext_lazy as _

Expand Down
1 change: 1 addition & 0 deletions tests/test_server_errors.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test that server errors generate the appropriate JSON response.
"""

from django.utils.translation import gettext as _

from rest_framework import status
Expand Down
1 change: 1 addition & 0 deletions vng_api_common/audittrails/migrations/_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is needed because of the merge with stable/1.0.x and master where different
migrations perform the same schema changes and are thus conflicting.
"""

from django.core.exceptions import FieldDoesNotExist
from django.db import migrations

Expand Down
1 change: 1 addition & 0 deletions vng_api_common/caching/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
and a decorator to enable conditional requests on viewsets. The rest are
implementation details.
"""

from .decorators import conditional_retrieve
from .etags import calculate_etag
from .models import ETagMixin
Expand Down
1 change: 1 addition & 0 deletions vng_api_common/caching/etags.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Calculate ETag values for API resources.
"""

import hashlib
import logging
from dataclasses import dataclass
Expand Down
1 change: 1 addition & 0 deletions vng_api_common/caching/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
The signal does nothing except clearing the calculated value, which will be
re-calculated on the next fetch.
"""

from typing import Optional, Set

from django.core.exceptions import FieldDoesNotExist
Expand Down
1 change: 1 addition & 0 deletions vng_api_common/client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Interface to get a zds_client object for a given URL.
"""

from typing import Optional

from django.apps import apps
Expand Down
6 changes: 3 additions & 3 deletions vng_api_common/exception_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ def get_validation_errors(validation_errors: dict):
for i, nested_error_dict in enumerate(error_list):
if isinstance(nested_error_dict, dict):
for err in get_validation_errors(nested_error_dict):
err[
"name"
] = f"{underscore_to_camel(field_name)}.{i}.{err['name']}"
err["name"] = (
f"{underscore_to_camel(field_name)}.{i}.{err['name']}"
)
yield err

# nested validation - recursively call the function
Expand Down
1 change: 1 addition & 0 deletions vng_api_common/inspectors/polymorphic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Bulk of the code taken from https://github.com/axnsan12/drf-yasg/issues/100
"""

from drf_yasg import openapi
from drf_yasg.errors import SwaggerGenerationError
from drf_yasg.inspectors.base import NotHandled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Due to the changes between Swagger 2.0 and OpenAPI 3.0, we cannot handle
this at the Python level.
"""

from django.core.management import BaseCommand

import oyaml as yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Due to the limitations of drf_yasg we cannot handle this at the Python level
"""

import os.path

from django.conf import settings
Expand Down
1 change: 1 addition & 0 deletions vng_api_common/oas.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This should get merged into gemma-zds-client, but some heavy refactoring is
needed for that.
"""

from typing import Union

import requests
Expand Down
1 change: 1 addition & 0 deletions vng_api_common/polymorphism.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
The serializer output will then either contain ``field_for_value2`` or
``field_for_value2``, depending on the value of the field ``type``.
"""

import logging
from collections import OrderedDict
from typing import Any, Dict, Union
Expand Down
8 changes: 5 additions & 3 deletions vng_api_common/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ def __call__(self, value):
raise ValidationError(
'Waarde "{0}" mag geen diakrieten of non-ascii tekens bevatten{1}'.format(
value,
" na de eerste {0} karakters".format(self.start)
if self.start
else "",
(
" na de eerste {0} karakters".format(self.start)
if self.start
else ""
),
)
)

Expand Down

0 comments on commit 22456c2

Please sign in to comment.