Opened 7 years ago

Closed 6 years ago

Last modified 4 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: UI/UX:

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 Changed 7 years ago by jacob

  • milestone set to 1.1
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 6 years ago by jacob

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in r10429.

comment:3 Changed 4 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

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