mirror of
https://github.com/pretix/pretix.git
synced 2026-08-06 10:07:50 +00:00
Fixes post-review
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user