Code

Opened 5 years ago

Closed 5 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: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

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 5 years ago.

Download all attachments as: .zip

Change History (3)

Changed 5 years ago by Nate

comment:1 Changed 5 years ago by thejaswi_puthraya

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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

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

Fixed in r10424

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.