From 05245c2776156aa90f3ff0a3795c0c444208f3ea Mon Sep 17 00:00:00 2001 From: alemi Date: Sat, 23 Mar 2024 06:10:33 +0100 Subject: [PATCH] fix: faker also insert config and credentials --- src/model/faker.rs | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/model/faker.rs b/src/model/faker.rs index a533a35..81cf263 100644 --- a/src/model/faker.rs +++ b/src/model/faker.rs @@ -1,4 +1,4 @@ -use crate::{activitypub::PUBLIC_TARGET, activitystream::object::actor::Actor}; +use crate::{activitypub::PUBLIC_TARGET, model::{config, credential}}; use super::{activity, object, user, Audience}; use sea_orm::IntoActiveModel; @@ -36,6 +36,21 @@ UQIDAQAB user::Entity::insert(root.clone().into_active_model()).exec(db).await?; + config::Entity::insert(config::ActiveModel { + id: Set(root.id.clone()), + accept_follow_requests: Set(true), + show_followers: Set(true), + show_following: Set(true), + show_following_count: Set(true), + show_followers_count: Set(true), + }).exec(db).await?; + + credential::Entity::insert(credential::ActiveModel { + id: Set(root.id.clone()), + email: Set("mail@example.net".to_string()), + password: Set("very-strong-password".to_string()), + }).exec(db).await?; + let context = uuid::Uuid::new_v4().to_string(); for i in (0..100).rev() { @@ -55,7 +70,7 @@ UQIDAQAB shares: Set(0), to: Set(Audience(vec![PUBLIC_TARGET.to_string()])), bto: Set(Audience::default()), - cc: Set(Audience(vec![root.followers().id().unwrap_or("").to_string()])), + cc: Set(Audience(vec![])), bcc: Set(Audience::default()), }).exec(db).await?; @@ -68,7 +83,7 @@ UQIDAQAB published: Set(chrono::Utc::now() - std::time::Duration::from_secs(60*i)), to: Set(Audience(vec![PUBLIC_TARGET.to_string()])), bto: Set(Audience::default()), - cc: Set(Audience(vec![root.followers().id().unwrap_or("").to_string()])), + cc: Set(Audience(vec![])), bcc: Set(Audience::default()), }).exec(db).await?; }