Small fixes to admin & script

This commit is contained in:
R. Miles McCain
2020-04-16 10:00:18 -04:00
parent 595d6cfd20
commit ac0f4cee73
4 changed files with 12 additions and 5 deletions

View File

@@ -6,6 +6,7 @@ from django.shortcuts import render, reverse
from django.utils import timezone
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
from django.conf import settings
from django.views.generic import TemplateView, View
from ipware import get_client_ip
@@ -64,6 +65,7 @@ class ScriptView(View):
return resp
def get(self, *args, **kwargs):
protocol = "https" if settings.SCRIPT_USE_HTTPS else "http"
endpoint = (
reverse(
"ingress:endpoint_script",
@@ -81,7 +83,7 @@ class ScriptView(View):
return render(
self.request,
"analytics/scripts/page.js",
context={"endpoint": endpoint},
context={"endpoint": endpoint, "protocol": protocol},
content_type="application/javascript",
)