1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #32260 -- Made View.as_view() do not use update_wrapper().

View.as_view() should not use update_wrapper() for copying attributes
it's unintended and have side-effects such as adding `self` to the
signature.

This also fixes system check for arguments of custom error handler
views with class-based views.

Co-authored-by: Nick Pope <nick.pope@flightdataservices.com>
This commit is contained in:
Daniyal
2020-12-12 01:00:50 +05:30
committed by Mariusz Felisiak
parent 0c0b87725b
commit 7c08f26bf0
7 changed files with 79 additions and 17 deletions

View File

@@ -0,0 +1,16 @@
urlpatterns = []
class HandlerView:
@classmethod
def as_view(cls):
def view():
pass
return view
handler400 = HandlerView.as_view()
handler403 = HandlerView.as_view()
handler404 = HandlerView.as_view()
handler500 = HandlerView.as_view()

View File

@@ -0,0 +1,9 @@
from django.views.generic import View
urlpatterns = []
handler400 = View.as_view()
handler403 = View.as_view()
handler404 = View.as_view()
handler500 = View.as_view()