Closed adamdoty closed 2 years ago
@adamdoty code seems good but I am hitting a few bugs testing it out with 2 users (baker / non baker):
When I request a treat I get this (btw the button says "redeem coupon" but I don't see any coupon in this form):
In the debugger I see this:
When I try to add or edit a coupon in the admin I also get a crash:
Changing that line to if self.treat and self.treat.is_recipient_request:
would fix it but I am not sure if self.treat
should be None
at this point (symptom vs cause)
With that change I do see records being updated:
Lastly the coupon page links to the treat:
Clicking edit treat on the treat page as a non-baker redirects me to login - good, but you can also add an if in the template to hide the edit links when not a baker:
Btw another TODO: would be to also prevent bakers from editing each other's treats. But let's not go there yet. Let's first focus on fixing the issues with redemption. Great work so far, let me know if you need help as you go with this ...
1st Django error message image - Yes this was a bug with fix in progress.
Coupon add/edit issue
Treat page for a treat request
Treat page for a recipient user
I would like to use the slugs in the urls - as antonio does in the blog application
localhost:8000/treat/buckeyes
OTHER
Flowchart submitted in PR:
= super helpful. Thanks.
its also in the readme as an image, but only in the calendar branch currently
coupon redemption for treat in the catalogue and coupon redemption for treat not in the catalogue complete