1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

Refs #32508 -- Raised ImproperlyConfigured/TypeError instead of using "assert" in various code.

This commit is contained in:
Mateo Radman
2021-06-20 20:16:33 +02:00
committed by Mariusz Felisiak
parent 64839512a6
commit 8a7ac78b70
7 changed files with 36 additions and 11 deletions

View File

@@ -80,8 +80,8 @@ class Signal:
# If DEBUG is on, check that we got a good receiver
if settings.configured and settings.DEBUG:
assert callable(receiver), "Signal receivers must be callable."
if not callable(receiver):
raise TypeError('Signal receivers must be callable.')
# Check for **kwargs
if not func_accepts_kwargs(receiver):
raise ValueError("Signal receivers must accept keyword arguments (**kwargs).")