mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-22 12:21:18 +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>> {
|
||||
is_admin(&local_user_view)?;
|
||||
|
||||
let allowlist = Instance::allowlist(&mut context.pool()).await?;
|
||||
if !allowlist.is_empty() {
|
||||
return Err(
|
||||
LemmyErrorType::Unknown("Using allowlist requires that blocklist be empty".to_string())
|
||||
.into(),
|
||||
);
|
||||
let blocklist = Instance::blocklist(&mut context.pool()).await?;
|
||||
if !blocklist.is_empty() {
|
||||
Err(LemmyErrorType::CannotCombineFederationBlocklistAndAllowlist)?;
|
||||
}
|
||||
|
||||
let instance_block_form = AdminAllowInstanceForm {
|
||||
|
|
|
@ -24,10 +24,7 @@ pub async fn admin_block_instance(
|
|||
|
||||
let allowlist = Instance::allowlist(&mut context.pool()).await?;
|
||||
if !allowlist.is_empty() {
|
||||
return Err(
|
||||
LemmyErrorType::Unknown("Using blocklist requires that allowlist be empty".to_string())
|
||||
.into(),
|
||||
);
|
||||
Err(LemmyErrorType::CannotCombineFederationBlocklistAndAllowlist)?;
|
||||
}
|
||||
|
||||
let instance_block_form = AdminBlockInstanceForm {
|
||||
|
|
|
@ -151,6 +151,7 @@ pub enum LemmyErrorType {
|
|||
CommunityHasNoFollowers,
|
||||
PostScheduleTimeMustBeInFuture,
|
||||
TooManyScheduledPosts,
|
||||
CannotCombineFederationBlocklistAndAllowlist,
|
||||
FederationError {
|
||||
#[cfg_attr(feature = "full", ts(optional))]
|
||||
error: Option<FederationError>,
|
||||
|
|
Loading…
Reference in a new issue