Skip to content

Commit

Permalink
[3.15] Add ValidationError params argument & default_params attribute (
Browse files Browse the repository at this point in the history
…#338)

* [3.15] Add ValidationError params argument & default_params attribute

* [pre-commit.ci] auto fixes from pre-commit.com hooks

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
intgr and pre-commit-ci[bot] authored Mar 19, 2024
1 parent 7b71a60 commit dd1dcf7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 5 additions & 1 deletion rest_framework-stubs/exceptions.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from collections.abc import Mapping, Sequence
from typing import Any
from typing import Any, ClassVar

from django.http import HttpRequest, JsonResponse
from django_stubs_ext import StrOrPromise
Expand Down Expand Up @@ -43,6 +43,10 @@ class APIException(Exception):
class ValidationError(APIException):
# ValidationError wraps `detail` in a list if it's not already a list/dict.
detail: list[_Detail] | dict[str, _Detail]
default_params: ClassVar[Mapping[str, Any]]
def __init__(
self, detail: _Detail | None = ..., code: str | None = ..., params: Mapping[str, Any] | None = ...
) -> None: ...

class ParseError(APIException): ...
class AuthenticationFailed(APIException): ...
Expand Down
4 changes: 0 additions & 4 deletions scripts/stubtest/allowlist_todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,6 @@ rest_framework.views.GenericView
rest_framework.RemovedInDRF317Warning
rest_framework.authtoken.migrations.0004_alter_tokenproxy_options
rest_framework.compat.distinct
rest_framework.exceptions.ValidationError.__init__
rest_framework.exceptions.ValidationError.default_params
rest_framework.fields.DecimalField.__init__
rest_framework.fields.Field.__class_getitem__
rest_framework.fields.logger
Expand All @@ -160,8 +158,6 @@ rest_framework.serializers.LIST_SERIALIZER_KWARGS_REMOVE
rest_framework.serializers.ListSerializer.run_child_validation
rest_framework.serializers.ModelSerializer.get_unique_together_constraints
rest_framework.serializers.Serializer.set_value
rest_framework.serializers.ValidationError.__init__
rest_framework.serializers.ValidationError.default_params
rest_framework.templatetags.rest_framework.optional_logout
rest_framework.utils.encoders.CustomScalar
rest_framework.utils.field_mapping.get_unique_validators

0 comments on commit dd1dcf7

Please sign in to comment.