#29282: Admin Checks May Raise TypeError
-----------------------------------------+------------------------
               Reporter:  David Sanders  |          Owner:  nobody
                   Type:  Bug            |         Status:  new
              Component:  contrib.admin  |        Version:  master
               Severity:  Normal         |       Keywords:
           Triage Stage:  Unreviewed     |      Has patch:  1
    Needs documentation:  0              |    Needs tests:  0
Patch needs improvement:  0              |  Easy pickings:  0
                  UI/UX:  0              |
-----------------------------------------+------------------------
 Admin checks include several calls to `issubclass` without a
 `try`/`catch`, allowing a `TypeError` to escape if the user provides a
 value that isn't a `class` for whatever is being checked. This seems like
 a sane-enough edge case to ensure the user gets a useful check failed
 message rather than an uncaught exception. Providing a PR that uses a
 helper function that catches the `TypeError` and returns `False` instead
 so that the half-dozen checks that use `issubclass` have minimal code
 change.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29282>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/053.681b53dfa9dd834e5529f72b3b5be3d7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to