Re: [Django] #21564: Generic base view http_method_not_allowed method references self.request and should use locally scoped request

2013-12-16 Thread Django
#21564: Generic base view http_method_not_allowed method references self.request
and should use locally scoped request
-+-
 Reporter:  adepue   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Generic views|  Version:  1.6
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
Has patch:  1|  checkin
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-
Changes (by Baptiste Mispelon ):

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


Comment:

 In [changeset:"e2f142030b81a37e1c3187f5d336dcb6014fd1c0"]:
 {{{
 #!CommitTicketReference repository=""
 revision="e2f142030b81a37e1c3187f5d336dcb6014fd1c0"
 Fixed #21564 -- Use local request object when possible in generic views.

 Thanks to trac user adepue for the report and original patch.
 }}}

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.e92d1ca7d42fae92e3e2bd68c90622ad%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21564: Generic base view http_method_not_allowed method references self.request and should use locally scoped request

2013-12-16 Thread Django
#21564: Generic base view http_method_not_allowed method references self.request
and should use locally scoped request
-+-
 Reporter:  adepue   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Generic views|  Version:  1.6
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Ready for
Has patch:  1|  checkin
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-
Changes (by timo):

 * needs_better_patch:  1 => 0
 * stage:  Accepted => Ready for checkin


-- 
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.779f4231aea4a401fd690789af08b43a%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21564: Generic base view http_method_not_allowed method references self.request and should use locally scoped request

2013-12-06 Thread Django
#21564: Generic base view http_method_not_allowed method references self.request
and should use locally scoped request
---+
 Reporter:  adepue |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Generic views  |  Version:  1.6
 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
---+

Comment (by timo):

 In addition, I was going to backport this to 1.6.X since it's a crashing
 issue. Could you add the following to docs/releases/1.6.1.txt as well?
 "Fixed a typo in
 :meth:`django.views.generic.base.View.http_method_not_allowed` that caused
 it to crash in some cases (#21564)." (feel free to amend as you see fit
 and to account for the request from bmispelon)?

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.5e5e92354ac8d551564f5ecdaa77616f%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21564: Generic base view http_method_not_allowed method references self.request and should use locally scoped request

2013-12-06 Thread Django
#21564: Generic base view http_method_not_allowed method references self.request
and should use locally scoped request
---+
 Reporter:  adepue |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Generic views  |  Version:  1.6
 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 bmispelon):

 * needs_better_patch:  0 => 1
 * stage:  Ready for checkin => Accepted


Comment:

 There's another instance of a similar behavior in `RedirectView.get`:
 https://github.com/django/django/blob/master/django/views/generic/base.py#L199

 Would you mind fixing that one too and adding a test for it?

 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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.1c92a0e6b0c2e4b05b0d08f791e6bd1c%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21564: Generic base view http_method_not_allowed method references self.request and should use locally scoped request

2013-12-06 Thread Django
#21564: Generic base view http_method_not_allowed method references self.request
and should use locally scoped request
-+-
 Reporter:  adepue   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Generic views|  Version:  1.6
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Ready for
Has patch:  1|  checkin
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-
Changes (by timo):

 * needs_tests:  1 => 0
 * stage:  Accepted => Ready for checkin


Old description:

> The current method in django/views/generic/base.py is:
>  def http_method_not_allowed(self, request, *args, **kwargs):
>  logger.warning('Method Not Allowed (%s): %s', request.method,
> request.path,
>  extra={
>  'status_code': 405,
>  'request': self.request
>  }
>  )
>  return http.HttpResponseNotAllowed(self._allowed_methods())
>
> The 'extra' dictionary should reference the locally scoped 'request'
> object instead of the class scoped member.
>
> There is a PR open with this fix:
> https://github.com/django/django/pull/2035
>

> The side effect is that any unit test written that uses the view and
> manually calls the dispatch method to validate non-allowed-methods will
> crash with  attribute not found error for request

New description:

 The current method in django/views/generic/base.py is:
 {{{
  def http_method_not_allowed(self, request, *args, **kwargs):
  logger.warning('Method Not Allowed (%s): %s', request.method,
 request.path,
  extra={
  'status_code': 405,
  'request': self.request
  }
  )
  return http.HttpResponseNotAllowed(self._allowed_methods())
 }}}
 The 'extra' dictionary should reference the locally scoped 'request'
 object instead of the class scoped member.

 There is a PR open with this fix:
 https://github.com/django/django/pull/2035


 The side effect is that any unit test written that uses the view and
 manually calls the dispatch method to validate non-allowed-methods will
 crash with  attribute not found error for request

--

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.fd480ead3e71781ebc1585554a17ceb3%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21564: Generic base view http_method_not_allowed method references self.request and should use locally scoped request

2013-12-05 Thread Django
#21564: Generic base view http_method_not_allowed method references self.request
and should use locally scoped request
---+
 Reporter:  adepue |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Generic views  |  Version:  1.6
 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
---+

Comment (by adepue):

 Test added to 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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.68f7c5608fc77b0dfea4f0d786eb7585%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21564: Generic base view http_method_not_allowed method references self.request and should use locally scoped request

2013-12-05 Thread Django
#21564: Generic base view http_method_not_allowed method references self.request
and should use locally scoped request
---+
 Reporter:  adepue |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Generic views  |  Version:  1.6
 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 claudep):

 * has_patch:  0 => 1
 * needs_tests:  0 => 1
 * stage:  Unreviewed => Accepted


-- 
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.50da69da1fe5943f4bd4a91d1019d7b3%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21564: Generic base view http_method_not_allowed method references self.request and should use locally scoped request

2013-12-05 Thread Django
#21564: Generic base view http_method_not_allowed method references self.request
and should use locally scoped request
---+--
 Reporter:  adepue |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Generic views  |  Version:  1.6
 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 adepue):

 * needs_better_patch:   => 0
 * type:  Uncategorized => Bug
 * needs_tests:   => 0
 * needs_docs:   => 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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.10a80e85da5c67bb6f18b2c40e5220b5%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Django] #21564: Generic base view http_method_not_allowed method references self.request and should use locally scoped request

2013-12-05 Thread Django
#21564: Generic base view http_method_not_allowed method references self.request
and should use locally scoped request
---+
 Reporter:  adepue |  Owner:  nobody
 Type:  Uncategorized  | Status:  new
Component:  Generic views  |Version:  1.6
 Severity:  Normal |   Keywords:
 Triage Stage:  Unreviewed |  Has patch:  0
Easy pickings:  0  |  UI/UX:  0
---+
 The current method in django/views/generic/base.py is:
  def http_method_not_allowed(self, request, *args, **kwargs):
  logger.warning('Method Not Allowed (%s): %s', request.method,
 request.path,
  extra={
  'status_code': 405,
  'request': self.request
  }
  )
  return http.HttpResponseNotAllowed(self._allowed_methods())

 The 'extra' dictionary should reference the locally scoped 'request'
 object instead of the class scoped member.

 There is a PR open with this fix:
 https://github.com/django/django/pull/2035


 The side effect is that any unit test written that uses the view and
 manually calls the dispatch method to validate non-allowed-methods will
 crash with  attribute not found error for request

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/049.c611f183d781813b611d90c1b215cc42%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.