Adding pretty print for activities.
This commit is contained in:
parent
f5b511ccce
commit
eef0a5c7e8
2 changed files with 8 additions and 3 deletions
|
@ -102,8 +102,9 @@ fn check_is_apub_id_valid(apub_id: &Url) -> Result<(), LemmyError> {
|
|||
|
||||
let mut allowed_instances = Settings::get().get_allowed_instances();
|
||||
let blocked_instances = Settings::get().get_blocked_instances();
|
||||
|
||||
if !allowed_instances.is_empty() {
|
||||
if allowed_instances.is_empty() && blocked_instances.is_empty() {
|
||||
Ok(())
|
||||
} else if !allowed_instances.is_empty() {
|
||||
// need to allow this explicitly because apub activities might contain objects from our local
|
||||
// instance. split is needed to remove the port in our federation test setup.
|
||||
allowed_instances.push(local_instance);
|
||||
|
|
|
@ -62,7 +62,11 @@ pub fn do_insert_activity<T>(
|
|||
where
|
||||
T: Serialize + Debug,
|
||||
{
|
||||
debug!("inserting activity for user {}, data {:?}", user_id, &data);
|
||||
debug!(
|
||||
"inserting activity for user {}, data {:?}",
|
||||
user_id,
|
||||
serde_json::to_string_pretty(&data).unwrap()
|
||||
);
|
||||
let activity_form = ActivityForm {
|
||||
user_id,
|
||||
data: serde_json::to_value(&data)?,
|
||||
|
|
Loading…
Reference in a new issue