]> Untitled Git - lemmy.git/blobdiff - crates/db_schema/src/impls/local_user.rs
Get rid of Safe Views, use serde_skip (#2767)
[lemmy.git] / crates / db_schema / src / impls / local_user.rs
index 650eac65c1d39f5cb1dabedb303e664e266ca794..a35096dca1cbcb90ebb4981fcf1ec033659b2921 100644 (file)
@@ -18,79 +18,6 @@ use bcrypt::{hash, DEFAULT_COST};
 use diesel::{dsl::insert_into, result::Error, ExpressionMethods, QueryDsl};
 use diesel_async::RunQueryDsl;
 
-mod safe_settings_type {
-  use crate::{
-    schema::local_user::columns::{
-      accepted_application,
-      default_listing_type,
-      default_sort_type,
-      email,
-      email_verified,
-      id,
-      interface_language,
-      person_id,
-      send_notifications_to_email,
-      show_avatars,
-      show_bot_accounts,
-      show_new_post_notifs,
-      show_nsfw,
-      show_read_posts,
-      show_scores,
-      theme,
-      validator_time,
-    },
-    source::local_user::LocalUser,
-    traits::ToSafeSettings,
-  };
-
-  type Columns = (
-    id,
-    person_id,
-    email,
-    show_nsfw,
-    theme,
-    default_sort_type,
-    default_listing_type,
-    interface_language,
-    show_avatars,
-    send_notifications_to_email,
-    validator_time,
-    show_bot_accounts,
-    show_scores,
-    show_read_posts,
-    show_new_post_notifs,
-    email_verified,
-    accepted_application,
-  );
-
-  impl ToSafeSettings for LocalUser {
-    type SafeSettingsColumns = Columns;
-
-    /// Includes everything but the hashed password
-    fn safe_settings_columns_tuple() -> Self::SafeSettingsColumns {
-      (
-        id,
-        person_id,
-        email,
-        show_nsfw,
-        theme,
-        default_sort_type,
-        default_listing_type,
-        interface_language,
-        show_avatars,
-        send_notifications_to_email,
-        validator_time,
-        show_bot_accounts,
-        show_scores,
-        show_read_posts,
-        show_new_post_notifs,
-        email_verified,
-        accepted_application,
-      )
-    }
-  }
-}
-
 impl LocalUser {
   pub async fn update_password(
     pool: &DbPool,