pub fn list(self) -> Result<Vec<UserView>, Error> {
use super::user_view::user_fast::dsl::*;
+ use diesel::sql_types::{Nullable, Text};
let mut query = self.query;
let (limit, offset) = limit_and_offset(self.page, self.limit);
query = query.limit(limit).offset(offset);
+ // The select is necessary here to not get back emails
+ query = query.select((
+ id,
+ actor_id,
+ name,
+ preferred_username,
+ avatar,
+ banner,
+ "".into_sql::<Nullable<Text>>(),
+ matrix_user_id,
+ bio,
+ local,
+ admin,
+ banned,
+ show_avatars,
+ send_notifications_to_email,
+ published,
+ number_of_posts,
+ post_score,
+ number_of_comments,
+ comment_score,
+ ));
query.load::<UserView>(self.conn)
}
}