From c4d0975313a948fe7ba0b046d923249570c52684 Mon Sep 17 00:00:00 2001 From: SDE Date: Mon, 18 Sep 2023 16:35:48 +0300 Subject: [PATCH] 0.7.39 add subscribes for static pages --- GeneralApp/views.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/GeneralApp/views.py b/GeneralApp/views.py index ebb044b..1c6cb16 100644 --- a/GeneralApp/views.py +++ b/GeneralApp/views.py @@ -59,6 +59,7 @@ def MainPage(request): def StaticPageView(request, url): from RoutesApp.forms import RouteForm + from SubscribesApp.models import Subscribe Dict = {} @@ -67,7 +68,7 @@ def StaticPageView(request, url): elif url == 'for_movers': Dict.update({ 'route_form': RouteForm(), - 'owner_type': 'customer' + 'owner_type': 'customer', }) elif url == 'for_customers': Dict.update({ @@ -79,6 +80,12 @@ def StaticPageView(request, url): elif url in ['main']: raise Http404 + if url in ['for_movers', 'for_customers']: + subscribes = Subscribe.objects.filter(enable=True) + Dict.update({ + 'subscribes': subscribes, + }) + try: page = StaticPage.objects.get(url=url) except StaticPage.DoesNotExist: