Django

Code

Ticket #10169 (closed: fixed)

Opened 1 year ago

Last modified 1 year ago

Redirect in contrib.comments incorrect with default template

Reported by: ryan_freckleton Assigned to: nobody
Milestone: 1.1 Component: django.contrib.comments
Version: 1.0 Keywords: comments redirect bug
Cc: Triage Stage: Accepted
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

The form generated by flagging in contrib.comments includes the following:

<input type="hidden" name="next" value="None" id="next" />

As you can see, the value is the string "None". This POST is passed to the next_redirect method in django.contrib.comments.views.utils, where it is check against this code (source:django/trunk/django/contrib/comments/views/utils.py):

next = data.get("next", default)
if next is None:
    next = urlresolvers.reverse(default_view)
if get_kwargs:
    next += "?" + urllib.urlencode(get_kwargs)
return HttpResponseRedirect(next)

Now, next is set to the string "None" when there isn't any redirect, since it exists the data.get('next', default) returns the string "None". Since there isn't any page called "None" this causes the redirect machinery to apparently go off into the weeds and not ever respond to the user with a page.

It seems like the template has to be changed to conditionally display the hidden input. I can code up a quick patch if this is the case.

Attachments

Change History

02/28/09 10:46:55 changed by jacob

  • needs_better_patch changed.
  • needs_docs changed.
  • stage changed from Unreviewed to Accepted.
  • needs_tests changed.
  • milestone set to 1.1.

04/07/09 15:25:26 changed by jacob

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in r10429.


Add/Change #10169 (Redirect in contrib.comments incorrect with default template)




Change Properties
Action