]> Untitled Git - lemmy.git/blobdiff - crates/db_schema/src/impls/community.rs
Making public key required. Fixes #1934
[lemmy.git] / crates / db_schema / src / impls / community.rs
index b2ebb3a0a2294386306a0eeaccbf5afa2f5d55e0..8adf2ba5778c68e76637e8387bbb1f8eca2cdd6b 100644 (file)
@@ -126,16 +126,6 @@ impl Community {
     community.select(actor_id).distinct().load::<String>(conn)
   }
 
-  pub fn read_from_followers_url(
-    conn: &PgConnection,
-    followers_url_: &DbUrl,
-  ) -> Result<Community, Error> {
-    use crate::schema::community::dsl::*;
-    community
-      .filter(followers_url.eq(followers_url_))
-      .first::<Self>(conn)
-  }
-
   pub fn upsert(conn: &PgConnection, community_form: &CommunityForm) -> Result<Community, Error> {
     use crate::schema::community::dsl::*;
     insert_into(community)
@@ -329,6 +319,7 @@ mod tests {
     let new_community = CommunityForm {
       name: "TIL".into(),
       title: "nada".to_owned(),
+      public_key: "nada".to_owned(),
       ..CommunityForm::default()
     };
 
@@ -347,7 +338,7 @@ mod tests {
       actor_id: inserted_community.actor_id.to_owned(),
       local: true,
       private_key: None,
-      public_key: None,
+      public_key: "nada".to_owned(),
       last_refreshed_at: inserted_community.published,
       icon: None,
       banner: None,