diff options
| author | mendespedro <pedro.mendes@solyd.com.br> | 2021-12-10 19:23:54 -0300 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-12-13 08:09:28 +0100 |
| commit | 75485d16a289c1fc4eb39702c14d2f08f0d8ccce (patch) | |
| tree | 64707ba124eee28936199d93270d449e62bab19b /django/urls | |
| parent | 7e4a9a9f696574a18f5c98f34d5a88e254b2d394 (diff) | |
Fixed #33351 -- Made path()/re_path() raise TypeError when kwargs argument is not a dict.
Diffstat (limited to 'django/urls')
| -rw-r--r-- | django/urls/conf.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/django/urls/conf.py b/django/urls/conf.py index b3937d5512..40990d10f5 100644 --- a/django/urls/conf.py +++ b/django/urls/conf.py @@ -57,6 +57,10 @@ def include(arg, namespace=None): def _path(route, view, kwargs=None, name=None, Pattern=None): from django.views import View + if kwargs is not None and not isinstance(kwargs, dict): + raise TypeError( + f'kwargs argument must be a dict, but got {kwargs.__class__.__name__}.' + ) if isinstance(view, (list, tuple)): # For include(...) processing. pattern = Pattern(route, is_endpoint=False) |
