Opened 15 years ago

Closed 15 years ago

#10735 closed (fixed)

Comment redirect breaks if you want to send get data

Reported by: Nate Owned by: nobody
Component: contrib.comments Version: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


I'm making a site where you can view models in sets, and the sets are specified with GET. So you may have a url like /entries/?set=first or something. With the django comment system, you can have the form redirect by setting "next" in a hidden field or the like, and the comment form redirects there when it's done. However, it sends get data of its own, and assumes that the url in "next" doesn't already have get data. In my case it does. Thus, django comments just sticks "?c=whatever" on the end of my url, which is wrong. I've supplied a patch that simply checks if the url has GET data (I just search for ".*?[/]*$", which is probably horribly wrong, but it works for my intents and purposes), and if that matches, comments uses "&" instead of "?".

Attachments (1)

comment_redirect_bug.diff (549 bytes ) - added by Nate 15 years ago.

Download all attachments as: .zip

Change History (3)

by Nate, 15 years ago

Attachment: comment_redirect_bug.diff added

comment:1 by Thejaswi Puthraya, 15 years ago

Your problem seems genuine, but can you please follow the coding style
adopted in django.

  • No imports within a function
  • I doubt if the
      'a' if something else 'b'
    works with Python-2.4 and earlier.

comment:2 by Chris Beaven, 15 years ago

Resolution: fixed
Status: newclosed

Fixed in r10424

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