mirror of https://github.com/LemmyNet/lemmy.git
parent
1c5c02e1bf
commit
d83a53e905
|
@ -280,11 +280,15 @@ pub async fn check_private_instance(
|
||||||
pool: &DbPool,
|
pool: &DbPool,
|
||||||
) -> Result<(), LemmyError> {
|
) -> Result<(), LemmyError> {
|
||||||
if local_user_view.is_none() {
|
if local_user_view.is_none() {
|
||||||
let site = blocking(pool, Site::read_simple).await??;
|
let site = blocking(pool, Site::read_simple).await?;
|
||||||
|
|
||||||
|
// The site might not be set up yet
|
||||||
|
if let Ok(site) = site {
|
||||||
if site.private_instance {
|
if site.private_instance {
|
||||||
return Err(LemmyError::from_message("instance_is_private"));
|
return Err(LemmyError::from_message("instance_is_private"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue