mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-25 10:51:03 +00:00
fix check
This commit is contained in:
parent
1e1ab68b29
commit
34d1d906a1
3 changed files with 5 additions and 10 deletions
|
@ -22,12 +22,9 @@ pub async fn admin_allow_instance(
|
||||||
) -> LemmyResult<Json<SuccessResponse>> {
|
) -> LemmyResult<Json<SuccessResponse>> {
|
||||||
is_admin(&local_user_view)?;
|
is_admin(&local_user_view)?;
|
||||||
|
|
||||||
let allowlist = Instance::allowlist(&mut context.pool()).await?;
|
let blocklist = Instance::blocklist(&mut context.pool()).await?;
|
||||||
if !allowlist.is_empty() {
|
if !blocklist.is_empty() {
|
||||||
return Err(
|
Err(LemmyErrorType::CannotCombineFederationBlocklistAndAllowlist)?;
|
||||||
LemmyErrorType::Unknown("Using allowlist requires that blocklist be empty".to_string())
|
|
||||||
.into(),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let instance_block_form = AdminAllowInstanceForm {
|
let instance_block_form = AdminAllowInstanceForm {
|
||||||
|
|
|
@ -24,10 +24,7 @@ pub async fn admin_block_instance(
|
||||||
|
|
||||||
let allowlist = Instance::allowlist(&mut context.pool()).await?;
|
let allowlist = Instance::allowlist(&mut context.pool()).await?;
|
||||||
if !allowlist.is_empty() {
|
if !allowlist.is_empty() {
|
||||||
return Err(
|
Err(LemmyErrorType::CannotCombineFederationBlocklistAndAllowlist)?;
|
||||||
LemmyErrorType::Unknown("Using blocklist requires that allowlist be empty".to_string())
|
|
||||||
.into(),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let instance_block_form = AdminBlockInstanceForm {
|
let instance_block_form = AdminBlockInstanceForm {
|
||||||
|
|
|
@ -151,6 +151,7 @@ pub enum LemmyErrorType {
|
||||||
CommunityHasNoFollowers,
|
CommunityHasNoFollowers,
|
||||||
PostScheduleTimeMustBeInFuture,
|
PostScheduleTimeMustBeInFuture,
|
||||||
TooManyScheduledPosts,
|
TooManyScheduledPosts,
|
||||||
|
CannotCombineFederationBlocklistAndAllowlist,
|
||||||
FederationError {
|
FederationError {
|
||||||
#[cfg_attr(feature = "full", ts(optional))]
|
#[cfg_attr(feature = "full", ts(optional))]
|
||||||
error: Option<FederationError>,
|
error: Option<FederationError>,
|
||||||
|
|
Loading…
Reference in a new issue