display bans in sorted order (fixes philomena-dev/philomena#66)

This commit is contained in:
byte[] 2020-11-15 21:00:05 -05:00
parent e058a212e7
commit 37adb661fb
4 changed files with 4 additions and 1 deletions

View file

@ -19,6 +19,7 @@ defmodule PhilomenaWeb.FingerprintProfileController do
fp_bans = fp_bans =
Fingerprint Fingerprint
|> where(fingerprint: ^fingerprint) |> where(fingerprint: ^fingerprint)
|> order_by(desc: :created_at)
|> Repo.all() |> Repo.all()
render(conn, "show.html", render(conn, "show.html",

View file

@ -21,6 +21,7 @@ defmodule PhilomenaWeb.IpProfileController do
subnet_bans = subnet_bans =
Subnet Subnet
|> where([s], fragment("? >>= ?", s.specification, ^ip)) |> where([s], fragment("? >>= ?", s.specification, ^ip))
|> order_by(desc: :created_at)
|> Repo.all() |> Repo.all()
render(conn, "show.html", render(conn, "show.html",

View file

@ -157,6 +157,7 @@ defmodule PhilomenaWeb.ProfileController do
bans = bans =
Bans.User Bans.User
|> where(user_id: ^user.id) |> where(user_id: ^user.id)
|> order_by(desc: :created_at)
|> Repo.all() |> Repo.all()
render( render(