Compare commits

..

2 Commits

Author SHA1 Message Date
c148cc5f10 New css 2020-08-12 21:07:24 +02:00
aa48af7c91 DeleteView success message 2020-08-12 21:07:13 +02:00
2 changed files with 8 additions and 2 deletions

View File

@ -212,7 +212,8 @@ body {
background-color: #f9f9f9; background-color: #f9f9f9;
font-family: Montserrat, Helvetica, sans-serif; font-family: Montserrat, Helvetica, sans-serif;
border-radius: 3px; border-radius: 3px;
font-weight: bold; } font-weight: bold;
box-shadow: 0 0 2px #565656; }
.LP-Message--error .LP-Message__Icon { .LP-Message--error .LP-Message__Icon {
background-color: #02979e; background-color: #02979e;
background-image: url("icons/error.png"); } background-image: url("icons/error.png"); }

View File

@ -135,8 +135,13 @@ class PlaceCreateView(IsAuthenticated, View):
) )
place_image.save() place_image.save()
class PlaceDeleteView(IsAuthenticated, IsSubmitter, SuccessMessageMixin, DeleteView): class PlaceDeleteView(IsAuthenticated, IsSubmitter, DeleteView):
template_name = 'place/place_delete.html' template_name = 'place/place_delete.html'
model = Place model = Place
success_message = 'Successfully deleted place.' success_message = 'Successfully deleted place.'
success_url = reverse_lazy('place_list') success_url = reverse_lazy('place_list')
success_message = 'Place deleted'
def delete(self, request, *args, **kwargs):
messages.success(self.request, self.success_message)
return super().delete(request, *args, **kwargs)