diff --git a/lostplaces/lostplaces_app/templates/place/place_delete.html b/lostplaces/lostplaces_app/templates/place/place_delete.html index ee3ef9a..2386abd 100644 --- a/lostplaces/lostplaces_app/templates/place/place_delete.html +++ b/lostplaces/lostplaces_app/templates/place/place_delete.html @@ -10,12 +10,14 @@ Place löschen {% csrf_token %}
-

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

-
- - -
-
- +

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

+
+ Cancel + + +
+ + {% endblock maincontent %} diff --git a/lostplaces/lostplaces_app/views.py b/lostplaces/lostplaces_app/views.py index 90486ac..ab0b67b 100644 --- a/lostplaces/lostplaces_app/views.py +++ b/lostplaces/lostplaces_app/views.py @@ -98,10 +98,6 @@ class PlaceCreateView(View): class PlaceDeleteView(DeleteView): template_name = 'place/place_delete.html' model = Place - success_url = reverse_lazy('place_list') - def post(self, request, *args, **kwargs): - if "cancel" in request.POST: - return redirect(self.success_url) - else: - return super(PlaceDeleteView, self).post(request, *args, **kwargs) + def get_success_url(self): + return reverse_lazy('place_list')