Add better tracking script protocol support

This commit is contained in:
R. Miles McCain
2020-05-07 17:49:02 -04:00
parent c84dac6b01
commit d88f61b281
2 changed files with 8 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ from django.core.cache import cache
from django.db.models import Q
from django.shortcuts import get_object_or_404, reverse
from django.utils import timezone
from django.conf import settings
from django.views.generic import (
CreateView,
DeleteView,
@@ -85,6 +86,11 @@ class ServiceUpdateView(
)
return resp
def get_context_data(self, *args, **kwargs):
data = super().get_context_data(*args, **kwargs)
data["script_protocol"] = "https://" if settings.SCRIPT_USE_HTTPS else "http://"
return data
class ServiceDeleteView(
LoginRequiredMixin, PermissionRequiredMixin, SuccessMessageMixin, DeleteView