PacktPublishing / Django-3-by-Example

Django 3 by Example (3rd Edition) published by Packt
https://djangobyexample.com/
MIT License
716 stars 687 forks source link

Fix automatic comment re-add on page reload #97

Open BumbaggioBenenbaum opened 3 years ago

BumbaggioBenenbaum commented 3 years ago

The code in the book (and here) contains a bug - after posting a comment, refreshing the page (F5) causes the same comment to be posted again, as many times as we refresh. A solution to this problem could be a HttpResponseRedirect using the respective post's get_absolute_url.