Fixes post-review

This commit is contained in:
Raphael Michel
2026-08-06 09:06:49 +02:00
parent fcd8f26cb1
commit 02ef36ca99
2 changed files with 5 additions and 13 deletions
+1 -1
View File
@@ -313,4 +313,4 @@ class DeviceLastSeen(models.Model):
@property
def is_recent(self):
# pretixSCAN/pretixPOS sync every 5 minutes, so 7 minutes can be considered "offline"
return self.last_seen - now() < timedelta(minutes=7)
return now() - self.last_seen < timedelta(minutes=7)
@@ -118,18 +118,10 @@
</td>
{% endif %}
<td>
{% if d.last_seen and d.last_seen.is_recent %}
<span class="fa fa-check-circle text-success"
data-toggle="tooltip"
title="{% if d.last_seen %}{% blocktrans with time=d.last_seen.last_seen|date:"SHORT_DATETIME_FORMAT" %}Last seen: {{ time }}{% endblocktrans %}{% else %}{% trans "No recent contact" %}{% endif %}"
></span>
{% else %}
<span class="fa fa-circle text-danger"
data-toggle="tooltip"
title="{% if d.last_seen %}{% blocktrans with time=d.last_seen.last_seen|date:"SHORT_DATETIME_FORMAT" %}Last seen: {{ time }}{% endblocktrans %}{% else %}{% trans "No recent contact" %}{% endif %}"
></span>
{% endif %}
<span class="fa fa-fw {% if d.last_seen and d.last_seen.is_recent %}fa-check-circle text-success{% else %}fa-circle text-danger{% endif %}"
data-toggle="tooltip"
title="{% if d.last_seen %}{% blocktrans with time=d.last_seen.last_seen|date:"SHORT_DATETIME_FORMAT" %}Last seen: {{ time }}{% endblocktrans %}{% else %}{% trans "No recent contact" %}{% endif %}"
></span>
{{ d.device_id }}
</td>
<td>