Show recent servers first

This commit is contained in:
Mouse Reeve 2021-09-12 10:02:15 -07:00
parent 22f01508d2
commit be7fae2053
2 changed files with 2 additions and 2 deletions

View file

@ -33,7 +33,7 @@
{% include 'snippets/table-sort-header.html' with field="server_name" sort=sort text=text %}
</th>
<th>
{% trans "Date federated" as text %}
{% trans "Date added" as text %}
{% include 'snippets/table-sort-header.html' with field="created_date" sort=sort text=text %}
</th>
<th>

View file

@ -29,7 +29,7 @@ class Federation(View):
sort = request.GET.get("sort")
sort_fields = ["created_date", "application_type", "server_name"]
if not sort in sort_fields + ["-{:s}".format(f) for f in sort_fields]:
sort = "created_date"
sort = "-created_date"
servers = servers.order_by(sort)
paginated = Paginator(servers, PAGE_LENGTH)