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:
committed by
Mariusz Felisiak
parent
0c0b87725b
commit
7c08f26bf0
16
tests/check_framework/urls/bad_class_based_error_handlers.py
Normal file
16
tests/check_framework/urls/bad_class_based_error_handlers.py
Normal 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()
|
||||
@@ -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()
|
||||
Reference in New Issue
Block a user