From a7c1c472fea9ff860b62ad25113cfed0f0d8e0bf Mon Sep 17 00:00:00 2001 From: Dessalines Date: Mon, 13 Jul 2020 09:42:03 -0400 Subject: [PATCH] Fixing admin and mod sort order. Fixes #939 (#941) --- server/lemmy_db/src/community_view.rs | 2 ++ server/lemmy_db/src/user_view.rs | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/server/lemmy_db/src/community_view.rs b/server/lemmy_db/src/community_view.rs index b465ddabc..5c6bd81a1 100644 --- a/server/lemmy_db/src/community_view.rs +++ b/server/lemmy_db/src/community_view.rs @@ -299,6 +299,7 @@ impl CommunityModeratorView { use super::community_view::community_moderator_view::dsl::*; community_moderator_view .filter(community_id.eq(from_community_id)) + .order_by(published) .load::(conn) } @@ -306,6 +307,7 @@ impl CommunityModeratorView { use super::community_view::community_moderator_view::dsl::*; community_moderator_view .filter(user_id.eq(from_user_id)) + .order_by(published) .load::(conn) } } diff --git a/server/lemmy_db/src/user_view.rs b/server/lemmy_db/src/user_view.rs index 84feba38f..f2ac47422 100644 --- a/server/lemmy_db/src/user_view.rs +++ b/server/lemmy_db/src/user_view.rs @@ -157,7 +157,10 @@ impl UserView { pub fn admins(conn: &PgConnection) -> Result, Error> { use super::user_view::user_fast::dsl::*; - user_fast.filter(admin.eq(true)).load::(conn) + user_fast + .filter(admin.eq(true)) + .order_by(published) + .load::(conn) } pub fn banned(conn: &PgConnection) -> Result, Error> {