mirror of https://github.com/LemmyNet/lemmy.git
Fixing private instance check. Fixes #2064
parent
f53902ecff
commit
80aaf81352
|
@ -280,11 +280,15 @@ pub async fn check_private_instance(
|
|||
pool: &DbPool,
|
||||
) -> Result<(), LemmyError> {
|
||||
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 {
|
||||
return Err(LemmyError::from_message("instance_is_private"));
|
||||
}
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
@ -161,7 +161,7 @@ where
|
|||
#[allow(clippy::to_string_in_display)]
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
// Use to_string here because Url.display is not useful for us
|
||||
write!(f, "{}", self.0.to_string())
|
||||
write!(f, "{}", self.0)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -97,11 +97,7 @@ async fn get_feed_data(
|
|||
let mut channel_builder = ChannelBuilder::default();
|
||||
channel_builder
|
||||
.namespaces(RSS_NAMESPACE.to_owned())
|
||||
.title(&format!(
|
||||
"{} - {}",
|
||||
site_view.site.name,
|
||||
listing_type.to_string()
|
||||
))
|
||||
.title(&format!("{} - {}", site_view.site.name, listing_type))
|
||||
.link(context.settings().get_protocol_and_hostname())
|
||||
.items(items);
|
||||
|
||||
|
|
Loading…
Reference in New Issue