Re: [Django] #32260: handler500 as a Class-based view raises SystemCheckError

2021-03-30 Thread Django
#32260: handler500 as a Class-based view raises SystemCheckError
-+-
 Reporter:  Daniyal Abbasi   |Owner:  Daniyal
 Type:   |  Abbasi
  Cleanup/optimization   |   Status:  closed
Component:  Core (System |  Version:  dev
  checks)|
 Severity:  Normal   |   Resolution:  fixed
 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 Mariusz Felisiak ):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"7c08f26bf0439c1ed593b51b51ad847f7e262bc1" 7c08f26b]:
 {{{
 #!CommitTicketReference repository=""
 revision="7c08f26bf0439c1ed593b51b51ad847f7e262bc1"
 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 
 }}}

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.16ea851a46ee1ecdcd3f9bb000419074%40djangoproject.com.


Re: [Django] #32260: handler500 as a Class-based view raises SystemCheckError

2021-03-30 Thread Django
#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
-+-

Comment (by Mariusz Felisiak ):

 In [changeset:"0c0b87725bbcffca3bc3a7a2c649995695a5ae3b" 0c0b8772]:
 {{{
 #!CommitTicketReference repository=""
 revision="0c0b87725bbcffca3bc3a7a2c649995695a5ae3b"
 Refs #32260 -- Made admindocs and technical 404 debug page use
 view_func.view_class.

 Internals of admindocs and technical 404 debug page should use the
 view_class attribute and do not rely on __name__.
 }}}

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.030c0a14874d33acba2a1700c9174b5b%40djangoproject.com.


Re: [Django] #32260: handler500 as a Class-based view raises SystemCheckError

2021-03-19 Thread Django
#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: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.19c8356c95e3e38d0d3d356fae17cbc2%40djangoproject.com.


Re: [Django] #32260: handler500 as a Class-based view raises SystemCheckError

2021-03-15 Thread Django
#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:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Nick Pope):

 * needs_tests:  1 => 0


-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.d694476f9464cecc41534ae1db7ec5a3%40djangoproject.com.


Re: [Django] #32260: handler500 as a Class-based view raises SystemCheckError

2021-03-14 Thread Django
#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:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  1|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Nick Pope):

 * version:  3.1 => dev
 * needs_tests:  0 => 1


-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.a4a2f7446d5412f2566619b0f3451529%40djangoproject.com.


Re: [Django] #32260: handler500 as a Class-based view raises SystemCheckError

2021-03-14 Thread Django
#32260: handler500 as a Class-based view raises SystemCheckError
-+-
 Reporter:  Daniyal Abbasi   |Owner:  Daniyal
 Type:   |  Abbasi
  Cleanup/optimization   |   Status:  assigned
Component:  Core (System |  Version:  3.1
  checks)|
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Daniyal Abbasi):

 An update [https://github.com/django/django/pull/14124 PR] has been
 created, as suggested in the comments of the previous PR!

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.43bc2b7fffbac640fc3d74edafa973b8%40djangoproject.com.


Re: [Django] #32260: handler500 as a Class-based view raises SystemCheckError

2021-03-14 Thread Django
#32260: handler500 as a Class-based view raises SystemCheckError
-+-
 Reporter:  Daniyal Abbasi   |Owner:  Daniyal
 Type:   |  Abbasi
  Cleanup/optimization   |   Status:  assigned
Component:  Core (System |  Version:  3.1
  checks)|
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Daniyal Abbasi):

 * needs_better_patch:  1 => 0


-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.f85a931527f1e51bce8c2f22ed956204%40djangoproject.com.


Re: [Django] #32260: handler500 as a Class-based view raises SystemCheckError

2021-01-12 Thread Django
#32260: handler500 as a Class-based view raises SystemCheckError
-+-
 Reporter:  Daniyal Abbasi   |Owner:  Daniyal
 Type:   |  Abbasi
  Cleanup/optimization   |   Status:  assigned
Component:  Core (System |  Version:  3.1
  checks)|
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * needs_better_patch:  0 => 1


Comment:

 Marking as "needs improvement" per
 [https://github.com/django/django/pull/13766#issuecomment-754053247 Adam's
 comment].

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.2875446b5f4ff12fb4856389c2b3c093%40djangoproject.com.


Re: [Django] #32260: handler500 as a Class-based view raises SystemCheckError

2020-12-15 Thread Django
#32260: handler500 as a Class-based view raises SystemCheckError
-+-
 Reporter:  Daniyal Abbasi   |Owner:  Daniyal
 Type:   |  Abbasi
  Cleanup/optimization   |   Status:  assigned
Component:  Core (System |  Version:  3.1
  checks)|
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Carlton Gibson):

 * has_patch:  0 => 1
 * type:  Bug => Cleanup/optimization
 * stage:  Unreviewed => Accepted


Comment:

 [https://github.com/django/django/pull/13766 PR]. OK, yes, using a CBV
 here is reasonable. It would be nice if the check handled that sensibly.
 Thanks.

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.49c9ecea8ca18a7d16a4c7fa417757e1%40djangoproject.com.


Re: [Django] #32260: handler500 as a Class-based view raises SystemCheckError

2020-12-11 Thread Django
#32260: handler500 as a Class-based view raises SystemCheckError
-+-
 Reporter:  Daniyal Abbasi   |Owner:  Daniyal
 |  Abbasi
 Type:  Bug  |   Status:  assigned
Component:  Core (System |  Version:  3.1
  checks)|
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Daniyal Abbasi):

 * owner:  nobody => Daniyal Abbasi
 * status:  new => assigned


Old description:

> Setting handler500 as a Class-Based view raises the following error which
> running checks.
>

> {{{
> $ python manage.py check
> SystemCheckError: System check identified some issues:
>
> ERRORS:
> ?: (urls.E007) The custom handler500 view 'path.to.my.MyView' does not
> take the correct number of arguments (request).
> }}}
>
> In my root urls.py, I have the following configuration,
>
> {{{
> handler404 = MyView.as_view()
> handler500 = MyView.as_view()
> }}}

New description:

 Setting handler500 as a Class-Based view raises the following error which
 running checks.


 {{{
 $ python manage.py check
 SystemCheckError: System check identified some issues:

 ERRORS:
 ?: (urls.E007) The custom handler500 view 'path.to.my.MyView' does not
 take the correct number of arguments (request).
 }}}

 In my root urls.py, I have the following configuration,

 {{{
 handler404 = MyView.as_view()
 handler500 = MyView.as_view()
 }}}


 I believe this is due to the function `_check_custom_error_handlers` in
 `django/urls/resolver.py`. The signature variable in this function is
 expected to match (request, exception) for all handlers except for
 handler500 which is expected to have only (request). A positional
 argument, template_name is also present.

 While using class based views, we get two positional arguments (self,
 request) and then it recieves *args and * *kwargs. The check is permitting
 other handlers as the number of arguments coincidentally match.

 I suggest a fix in the `_check_custom_error_handlers` which first checks
 if the handler* are function based or class based, and then it preceed the
 check with the appropriate number of arguments.

--

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.edd43afda310c99c5d0b6d3166454328%40djangoproject.com.


[Django] #32260: handler500 as a Class-based view raises SystemCheckError

2020-12-11 Thread Django
#32260: handler500 as a Class-based view raises SystemCheckError
+
   Reporter:  Daniyal Abbasi|  Owner:  nobody
   Type:  Bug   | Status:  new
  Component:  Core (System checks)  |Version:  3.1
   Severity:  Normal|   Keywords:
   Triage Stage:  Unreviewed|  Has patch:  0
Needs documentation:  0 |Needs tests:  0
Patch needs improvement:  0 |  Easy pickings:  0
  UI/UX:  0 |
+
 Setting handler500 as a Class-Based view raises the following error which
 running checks.


 {{{
 $ python manage.py check
 SystemCheckError: System check identified some issues:

 ERRORS:
 ?: (urls.E007) The custom handler500 view 'path.to.my.MyView' does not
 take the correct number of arguments (request).
 }}}

 In my root urls.py, I have the following configuration,

 {{{
 handler404 = MyView.as_view()
 handler500 = MyView.as_view()
 }}}

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/056.b81fb3c709ddd271180bb52b5742ef57%40djangoproject.com.