Opened 15 years ago

Closed 15 years ago

Last modified 13 years ago

#10169 closed (fixed)

Redirect in contrib.comments incorrect with default template

Reported by: Ryan Freckleton Owned by: nobody
Component: contrib.comments Version: 1.0
Severity: Keywords: comments redirect bug
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

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.

Change History (3)

comment:1 by Jacob, 15 years ago

milestone: 1.1
Triage Stage: UnreviewedAccepted

comment:2 by Jacob, 15 years ago

Resolution: fixed
Status: newclosed

Fixed in r10429.

comment:3 by Jacob, 13 years ago

milestone: 1.1

Milestone 1.1 deleted

Note: See TracTickets for help on using tickets.
Back to Top