Possible regression with serializers in 1.4
Hi, I'm working on porting a large codebase to 1.4 (using the rc), and have run into what appears to be a regression in the serializers. I wanted to run it past some eyes here before I raise a ticket. The Python serializer's handle_fk_field() method now no longer handles the case where a related object is None and natural keys are in use. The problem appears to have been introduced in this changeset: https://code.djangoproject.com/changeset/17439 The code now no longer checks to see if the `related` object is not None before attempting to call natural_key() on it. Should I raise a ticket for this one? Cheers, Dan -- Dan Fairs | dan.fa...@gmail.com | www.fezconsulting.com -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
Re: Possible regression with serializers in 1.4
On 12.03.2012, at 08:19, Dan Fairs wrote: > Hi, > > I'm working on porting a large codebase to 1.4 (using the rc), and have run > into what appears to be a regression in the serializers. I wanted to run it > past some eyes here before I raise a ticket. > > The Python serializer's handle_fk_field() method now no longer handles the > case where a related object is None and natural keys are in use. The problem > appears to have been introduced in this changeset: > > https://code.djangoproject.com/changeset/17439 > > The code now no longer checks to see if the `related` object is not None > before attempting to call natural_key() on it. > > Should I raise a ticket for this one? Yes, please. Jannis signature.asc Description: Message signed with OpenPGP using GPGMail
issue 15644
Is this bug fix too late for the upcoming release? https://code.djangoproject.com/ticket/15644 -- You received this message because you are subscribed to the Google Groups "Django developers" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-developers/-/JGmurY1OqwcJ. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
Re: Improving docs for User.is_authenticated()
On Thursday, February 23, 2012 10:41:36 AM UTC-5, Tom Evans wrote: I don't like this function that much. > I share that sentiment. When it becomes possible to refactor auth.User, I hope we'll be able to first deprecate and then remove User.is_authenticated() and User.is_anonymous(). In addition to the point you raised (that these methods don't actually test that the user has in fact authenticated), there is also the possible source of confusion stemming from the fact that in template language we write: {% if user.is_authenticated %} but in Python we write: if user.is_authenticated(): You could easily get used to writing it the first way if you do a lot of template development, and then accidentally write it that way when you switch back to Python: if user.is_authenticated: which will happily and quietly always evaluate to True. Perhaps the presence of a user object on the request object ought to be enough to indicate that a user has authenticated. If so, maybe AnonymousUser could be retired. Cheers, Clay -- You received this message because you are subscribed to the Google Groups "Django developers" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-developers/-/oqia2g66GLQJ. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
Re: Improving docs for User.is_authenticated()
On March 12, 2012, at 14:47 , Clay McClure wrote: > On Thursday, February 23, 2012 10:41:36 AM UTC-5, Tom Evans wrote: > there is also the possible source of confusion stemming from the fact that > in template language we write: > > {% if user.is_authenticated %} > > but in Python we write: > > if user.is_authenticated(): > > You could easily get used to writing it the first way if you do a lot of > template development, and then accidentally write it that way when you switch > back to Python: > > if user.is_authenticated: > > which will happily and quietly always evaluate to True. I've made this error. It's a pita to debug, too. Regards, Luke -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.