def post(self, request, *args, **kwargs): if not onboarding_complete(request): messages.error(request, _("There are still some pending actions to complete!")) return HttpResponseRedirect(reverse("shuup_admin:home")) enable = request.POST.get("enable", True) if kwargs.get("pk") == str(request.shop.pk): shop = request.shop else: shop = Shop.objects.filter(pk=kwargs.get("pk")).first() shop.maintenance_mode = not enable shop.save() messages.info(request, _("Your store is now live!")) return HttpResponseRedirect(request.POST.get("redirect"))