diff --git a/core/templates/core/macros_pages.jinja b/core/templates/core/macros_pages.jinja
index c18bfe31..79228ae7 100644
--- a/core/templates/core/macros_pages.jinja
+++ b/core/templates/core/macros_pages.jinja
@@ -3,17 +3,18 @@
{% macro page_history(page) %}
{% trans page_name=page.name %}You're seeing the history of page "{{ page_name }}"{% endtrans %}
- {% for r in (page.revisions.all()|sort(attribute='date', reverse=True)) %}
- {% if loop.index < 2 %}
- - {% trans %}last{% endtrans %} -
- {{ user_profile_link(page.revisions.last().author) }} -
- {{ page.revisions.last().date|localtime|date(DATETIME_FORMAT) }} {{ page.revisions.last().date|localtime|time(DATETIME_FORMAT) }}
- {% else %}
- - {{ r.revision }} -
- {{ user_profile_link(r.author) }} -
- {{ r.date|localtime|date(DATETIME_FORMAT) }} {{ r.date|localtime|time(DATETIME_FORMAT) }}
- {% endif %}
- {% endfor %}
+ {% set page_name = page.get_full_name() %}
+ {%- for rev in page.revisions.order_by("-date").select_related("author") -%}
+ -
+ {% if loop.first %}
+ {% trans %}last{% endtrans %}
+ {% else %}
+ {{ rev.revision }}
+ {% endif %}
+ {{ user_profile_link(rev.author) }} -
+ {{ rev.date|localtime|date(DATETIME_FORMAT) }} {{ rev.date|localtime|time(DATETIME_FORMAT) }}
+
+ {%- endfor -%}
{% endmacro %}