slugbucket / crossword-hints

Python Flask web application to aid decipherment of cryptic crossword clues for known setters
GNU General Public License v3.0
1 stars 0 forks source link

Add sticky page numbers when editing solutions - feat0016 #21

Closed slugbucket closed 4 years ago

slugbucket commented 5 years ago

Editing or adding a solution always returns to the page page in the list. It would be better to return to the same page being displayed prior to the update.

slugbucket commented 5 years ago

Track as feature/feat0016

slugbucket commented 4 years ago

Care needs to be taken when using the session vaoue for the page number because if searching for a solution from, say, page 29, the returned results will likely only have one page's worth of values which will confuse (and break) the offset calculation and pagination. The session page number is reset in the event that no results are returned; this might break an empty search.

slugbucket commented 4 years ago

The session value for the page number is only reset in the event of an error, so if a search resturns an empty result going back to the solutions page will go back to the previous numbered page; the session is onl;t reset when an exception occurs.