Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #747 (closed defect: fixed)

Opened 11 years ago

Last modified 10 years ago

[PATCH] Flash precedence fix

Reported by: andrey.lebedev@… Owned by: anonymous
Priority: normal Milestone:
Component: CherryPy Version: 0.9a4
Severity: normal Keywords: patch
Cc:

Description

Patch attached fixes a subtle bug in turbogears.flash mechanism:

If a controller method sets a flash message and returns dictionary, flash message should be visible on rendered template. Currently turbogears works like this, with the only exception: if tg_flash cookie exists (it was set in one of the previous requests ), it is used as flash message, regardless of what was set in current request.

Attached patch fixes this behavour: the latest flash will be displayed. Unit test included.

Attachments

flash-precedence.patch Download (2.2 KB) - added by andrey.lebedev@… 11 years ago.
flash precedence patch with tests
flash-precedence-v2.patch Download (2.0 KB) - added by andrey.lebedev@… 11 years ago.

Change History

Changed 11 years ago by andrey.lebedev@…

flash precedence patch with tests

comment:1 Changed 11 years ago by michele

  • Summary changed from Flash precedence fix to [PATCH] Flash precedence fix

comment:2 Changed 11 years ago by alberto

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

Committed at [1134]. Thanks!

comment:3 Changed 11 years ago by andrey.lebedev@…

  • Status changed from closed to reopened
  • Resolution fixed deleted

Just discovered other small related problem: old stale cookie should be cleared after flash was read.

Attaching patch to the latest svn revision.

Changed 11 years ago by andrey.lebedev@…

comment:4 Changed 11 years ago by michele

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

Committed the second patch in r1136. Thanks Andrey.

Note: See TracTickets for help on using tickets.