Fix flash message when books are edited
Closes #10674
This PR fixes the flash message when books are edited, changing the copy to "Thank you for improving the Open Library catalog!", as well as fixing the previous pull request that accidentally incorporated many unrelated changes.
Technical
1: In messages.html, flash_book_added, flash_book_updated, and flash_work_updated were deleted/condensed into the variable flash_catalog_updated , which returns = "Thank you very much for improving that record!"
2: In addbook.py, the variable flash_catalog_updated is used to address both adding and editing, and instances of the previous three variables (flash_book_added, flash_book_updated, and flash_work_updated) are changed to flash_catalog_updated.
2: (Breakdown) The error may have been occurring due to how revision = 1 in the variable add's logic. I noticed that the first time an edit is made, the incorrect flash message ("Thank you very much for adding that new book!") would show, but all subsequent edits would receive the correct flash message ("Thank you very much for improving that record!"). Revision is still = 1 when the first edit is made, making add = True.
Book is created in catalog → revision = 1 First edit is made → revision is still = 1 → add = True After the first edit, revision increments to 2 Second edit is made → revision is still = 2 → second edit is correctly identified as an "edit"
Testing
1: Edit an edition that has a "Read" button 2: Read the flash message Expected behavior: Flash message reads: "Thank you for improving the Open Library catalog!"
Screenshot
Stakeholders
@jimchamp
Any updates, @Amara777?
Hi @jimchamp yes, I can make those changes by EOD, thank you for the additional context
Hi, I made the additional changes, please let me know if anything else needs to be fixed! I can also be reached over slack if needed.
Hi @jimchamp thanks for all of your help, I merged your PR into this branch I believe. Is there anything further that should be adjusted?