Bake It Better is a blog-style website for users to share baking recipes. The site has been created for the fourth portfolio project for Code Institute's Diploma in Full Stack Software Development.
As a site user, I can edit bakes that I have already added, so that I can add information or correct a mistake without needing to start again.
Acceptance Criteria
When a user is logged in, that user is able to edit a bake via a link that appears for the signed-in author only.
When a user has successfully edited a bake, the bake will be updated in the main list of bakes and the user will see a success message notifying them that the bake has been updated.
When a user clicks 'Submit' to finish modifying a bake, they are taken to the detailed view of that bake.
If a user has clicked on the form to edit a bake and then changes their mind, they should be able to return to the main list of bakes via a 'Cancel' button.
A user should only be able to modify bakes that they have created themselves. Users should receive a 403 warning if they attempt to edit a bake authored by another user.
Tasks:
Add Update view to modify a bake in views.py
Add path in urls.py
Add edit-bake.html template and code within the template to render form, as well as 'Cancel' button
Include LoginRequiredMixin and UserPassesTestMixin in Update view so that only a signed-in author user is allowed to edit a bake
Add a success message to confirm when a bake has been edited
As a site user, I can edit bakes that I have already added, so that I can add information or correct a mistake without needing to start again.
Acceptance Criteria
Tasks: