Small bug fixes
This commit is contained in:
parent
6d542e81e5
commit
d84ed28ef7
@ -44,7 +44,7 @@ def ingress_request(
|
||||
service_uuid, tracker, time, payload, ip, location, user_agent, identifier=""
|
||||
):
|
||||
try:
|
||||
service = Service.objects.get(uuid=service_uuid, status=Service.ACTIVE)
|
||||
service = Service.objects.get(pk=service_uuid, status=Service.ACTIVE)
|
||||
log.debug(f"Linked to service {service}")
|
||||
|
||||
ip_data = _geoip2_lookup(ip)
|
||||
|
@ -15,8 +15,8 @@ from ..tasks import ingress_request
|
||||
def ingress(request, service_uuid, identifier, tracker, payload):
|
||||
time = timezone.now()
|
||||
client_ip, is_routable = get_client_ip(request)
|
||||
location = request.META.get("HTTP_REFERER")
|
||||
user_agent = request.META.get("HTTP_USER_AGENT")
|
||||
location = request.META.get("HTTP_REFERER") or ""
|
||||
user_agent = request.META.get("HTTP_USER_AGENT") or ""
|
||||
|
||||
ingress_request.delay(
|
||||
service_uuid,
|
||||
|
@ -80,7 +80,7 @@
|
||||
<tbody>
|
||||
{% for location in stats.locations %}
|
||||
<tr>
|
||||
<td>{{location.location|urldisplay}}</td>
|
||||
<td>{{location.location|default:"Unknown"|urldisplay}}</td>
|
||||
<td class="rf">{{location.count|intcomma}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
@ -73,7 +73,7 @@
|
||||
</div>
|
||||
<div class="md:flex card ~neutral !low flex-grow justify-between">
|
||||
<div class="mb-4 md:mb-0 md:w-1/2">
|
||||
<p class="label font-medium text-lg">{{hit.location|urlize}}</p>
|
||||
<p class="label font-medium text-lg">{{hit.location|default:"Unknown"|urlize}}</p>
|
||||
{% if hit.referrer %}
|
||||
<p>via {{hit.referrer|urlize}}<p>
|
||||
{% endif %}
|
||||
|
@ -14,8 +14,8 @@
|
||||
<p>Place the following snippet at the end of the <code><body></code> tag on any page you'd like to track.</p>
|
||||
<div class="card ~neutral !high font-mono text-sm">
|
||||
{% filter force_escape %}<noscript><img
|
||||
src="{{base_url}}/ingress/fc4008d3-f2fa-4500-9968-d96719e3819c/pixel.gif"></noscript>
|
||||
<script src="{{base_url}}/ingress/fc4008d3-f2fa-4500-9968-d96719e3819c/identifier/script.js"></script>
|
||||
src="//{{request.site.domain}}/ingress/{{object.uuid}}/pixel.gif"></noscript>
|
||||
<script src="//{{request.site.domain}}/ingress/{{object.uuid}}/identifier/script.js"></script>
|
||||
{% endfilter %}
|
||||
</div>
|
||||
<hr class="sep h-4">
|
||||
|
@ -214,7 +214,7 @@ SITE_ID = 1
|
||||
|
||||
# Celery
|
||||
|
||||
CELERY_TASK_ALWAYS_EAGER = True
|
||||
CELERY_TASK_ALWAYS_EAGER = os.getenv("CELERY_TASK_ALWAYS_EAGER", "False") == "True"
|
||||
|
||||
CELERY_BROKER_URL = os.getenv("CELERY_BROKER_URL")
|
||||
CELERY_REDIS_SOCKET_TIMEOUT = 15
|
||||
|
Loading…
Reference in New Issue
Block a user