kadenios/shared/views.py

20 lines
639 B
Python
Raw Permalink Normal View History

from django.contrib import messages
from django.views.generic import RedirectView
# #############################################################################
# Utils Views
# #############################################################################
class BackgroundUpdateView(RedirectView):
success_message = ""
def get_success_message(self):
return self.success_message
def get(self, request, *args, **kwargs):
success_message = self.get_success_message()
if success_message:
messages.success(self.request, success_message)
return super().get(request, *args, **kwargs)