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:
committed by
Mariusz Felisiak
parent
64839512a6
commit
8a7ac78b70
@@ -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).")
|
||||
|
||||
Reference in New Issue
Block a user