]> Untitled Git - lemmy.git/commitdiff
Fixing admin and mod sort order. Fixes #939 (#941)
authorDessalines <dessalines@users.noreply.github.com>
Mon, 13 Jul 2020 13:42:03 +0000 (09:42 -0400)
committerGitHub <noreply@github.com>
Mon, 13 Jul 2020 13:42:03 +0000 (09:42 -0400)
server/lemmy_db/src/community_view.rs
server/lemmy_db/src/user_view.rs

index b465ddabc71c0079fd62557147cb7a61adfaf109..5c6bd81a19590dc2c0dd62ae221616cc7a2cd983 100644 (file)
@@ -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::<Self>(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::<Self>(conn)
   }
 }
index 84feba38f95920f50d7693eb39bff5b0ce47b7e2..f2ac47422492ecc9ad0a2bf7d918a333d2ea855c 100644 (file)
@@ -157,7 +157,10 @@ impl UserView {
 
   pub fn admins(conn: &PgConnection) -> Result<Vec<Self>, Error> {
     use super::user_view::user_fast::dsl::*;
-    user_fast.filter(admin.eq(true)).load::<Self>(conn)
+    user_fast
+      .filter(admin.eq(true))
+      .order_by(published)
+      .load::<Self>(conn)
   }
 
   pub fn banned(conn: &PgConnection) -> Result<Vec<Self>, Error> {