Skip to content

Commit

Permalink
Sync settings filtering customization with changes in Django (typeddj…
Browse files Browse the repository at this point in the history
…ango#1540)

Since Django 3.1, the module-level `CLEANSED_SUBSTITUTE` has been
replaced by `SafeExceptionReporterFilter.cleansed_substitute`.

Also the module-level `HIDDEN_SETTINGS` has been replaced by
`SafeExceptionReporterFilter.cleansed_substitute.hidden_settings`,
but this variable wasn't included in the stubs before.

django/django@581ba5a
  • Loading branch information
mthuurne authored Jun 12, 2023
1 parent 78871df commit 57fbd5b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions django-stubs/views/debug.pyi
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
from collections.abc import Callable, ItemsView, Iterator
from pathlib import Path
from types import TracebackType
from typing import Any
from typing import Any, Pattern

from django.http.request import HttpRequest, QueryDict
from django.http.response import Http404, HttpResponse
from django.utils.safestring import SafeString

CLEANSED_SUBSTITUTE: str
CURRENT_DIR: Path

class CallableSettingWrapper:
Expand All @@ -24,6 +23,8 @@ def get_default_exception_reporter_filter() -> SafeExceptionReporterFilter: ...
def get_exception_reporter_filter(request: HttpRequest | None) -> SafeExceptionReporterFilter: ...

class SafeExceptionReporterFilter:
cleansed_substitute: str
hidden_settings: Pattern[str]
def cleanse_setting(self, key: int | str, value: Any) -> Any: ...
def get_safe_settings(self) -> dict[str, Any]: ...
def is_active(self, request: HttpRequest | None) -> bool: ...
Expand Down

0 comments on commit 57fbd5b

Please sign in to comment.