Opened 6 years ago

Closed 5 years ago

#11110 closed (fixed)

Comments redirect after posting is not honoured if comment contains errors or is previewed

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

Description

Hello,

In using the comments framework, I have experienced some odd behaviour with regard to the "next" redirection. Provided that one specifies a value for "next" as part of the context for the template that contains the comment form, users posting valid comments without previewing them will indeed be redirected as expected. However, if the commenter previews his comment before posting, or if his comment contains errors, the "next" value is not honoured -- the user is redirected to the default "Thank you for your comment" page.

For what it's worth, my use of the comments framework is extremely simple -- within my template, I use {% render_comment_form for post %}. "next" is passed as part of the template context from within the view.

Attached is a simple patch that resolves the issue for my use of the comments framework. I fear that my issue may not be a bug at all and that I'm missing something obvious, but I took the precaution of asking about it on django-users (http://groups.google.com/group/django-users/browse_thread/thread/2f6768b95cb9a10e), and I received no responses within 24 hours.

Thanks,

Jeff

Attachments (2)

make_next_redirect_apply_across_comment_preview.diff (530 bytes) - added by Jeff Winters <micand7@…> 6 years ago.
next_redirect_via_comment_preview.diff (1.7 KB) - added by kgfullerton 6 years ago.

Download all attachments as: .zip

Change History (6)

Changed 6 years ago by Jeff Winters <micand7@…>

comment:1 Changed 6 years ago by SmileyChris

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

Hey Jeff, would you like to have a crack at adding a test case to show the current failure (in `tests/regressiontests/comment_tests')?

Changed 6 years ago by kgfullerton

comment:2 Changed 6 years ago by kgfullerton

Added patch which contains the fix for revision 10957 as well as test case - not sure why the diff isn't showing (is the output from svn diff)

comment:3 Changed 6 years ago by SafPlusPlus <freark@…>

  • Needs tests unset

comment:4 Changed 5 years ago by jezdez

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

I believe this has been fixed in [11019].

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