#32260: handler500 as a Class-based view raises SystemCheckError
-------------------------------------+-------------------------------------
Reporter: Daniyal Abbasi | Owner: Daniyal
Type: | Abbasi
Cleanup/optimization | Status: assigned
Component: Core (System | Version: dev
checks) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Nick Pope):
* stage: Accepted => Ready for checkin
Comment:
So we've got consensus on the approach from a few people reviewing on
GitHub.
It turned out that this was a bit more messy than expected due to the use
of `functools.update_wrapper()`. This adds `__wrapped__` which was causing
the issue with the signature inspection. We also noticed that this caused
clobbering of the `__name__` and `__qualname__` of the generated view
function with those of the class which is misleading. We already have
`.view_class` available, so that should be used.
The first part of the solution is Adam's
[https://github.com/django/django/pull/14138 PR] that makes use of
`.view_class` appropriately in various places.
The second part (which will need rebasing on top of the first part) is
Daniyal's [https://github.com/django/django/pull/14124 PR] that stops
using `functools.update_wrapper()` and only sets certain special
attributes.
Marking this as RFC.
--
Ticket URL: <https://code.djangoproject.com/ticket/32260#comment:8>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/071.19c8356c95e3e38d0d3d356fae17cbc2%40djangoproject.com.