Just compare the live revision id, rather than the whole object

This avoid running a query, which in this case would be `n`
pull/7316/head
Jake Howard 2021-07-02 17:34:17 +01:00 zatwierdzone przez Matt Westcott
rodzic 07490bfb18
commit 02d8dac97e
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -38,7 +38,7 @@
{% endwith %}
{% if entry.revision %}
{% if entry.action == 'wagtail.publish' %}
{% if entry.revision == page.live_revision %}<span class="status-tag primary">{% trans 'Live version' %}</span>{% endif %}
{% if entry.revision_id == page.live_revision_id %}<span class="status-tag primary">{% trans 'Live version' %}</span>{% endif %}
{% elif entry.content_changed %}
{% if entry.revision == page_latest_revision %}<span class="status-tag primary">{% trans 'Current draft' %}</span>{% endif %}
{% include "wagtailadmin/pages/revisions/_actions.html" with revision=entry.revision %}