Small fixes to admin & script
This commit is contained in:
@@ -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",
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user