mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-23 11:21:32 +00:00
parent
1c5c02e1bf
commit
d83a53e905
1 changed files with 7 additions and 3 deletions
|
@ -280,9 +280,13 @@ pub async fn check_private_instance(
|
|||
pool: &DbPool,
|
||||
) -> Result<(), LemmyError> {
|
||||
if local_user_view.is_none() {
|
||||
let site = blocking(pool, Site::read_simple).await??;
|
||||
if site.private_instance {
|
||||
return Err(LemmyError::from_message("instance_is_private"));
|
||||
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 {
|
||||
return Err(LemmyError::from_message("instance_is_private"));
|
||||
}
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
|
Loading…
Reference in a new issue