diff --git a/lostplaces/lostplaces_app/templates/place/place_delete.html b/lostplaces/lostplaces_app/templates/place/place_delete.html index 027a593..3f06c2f 100644 --- a/lostplaces/lostplaces_app/templates/place/place_delete.html +++ b/lostplaces/lostplaces_app/templates/place/place_delete.html @@ -7,7 +7,7 @@
- Place löschen + Delete place {% csrf_token %}

Are you sure you want to delete "{{place.name}}"?

diff --git a/lostplaces/lostplaces_app/views.py b/lostplaces/lostplaces_app/views.py index 5ee901c..47e25bb 100644 --- a/lostplaces/lostplaces_app/views.py +++ b/lostplaces/lostplaces_app/views.py @@ -107,9 +107,9 @@ class PlaceDeleteView(UserPassesTestMixin, DeleteView): if self.request.user.is_superuser: return True + # Check if currently logged in user was the submitter place_obj = self.get_object() - # Check if currently logged in user was the submitter if self.request.user == place_obj.submitted_by: return True