Fix statuses again (#497)

* Fix statuses again

* Make it compile
This commit is contained in:
Geometrically
2022-12-08 17:25:24 -07:00
committed by GitHub
parent a5f9331023
commit 30b29de8ce

View File

@@ -457,6 +457,18 @@ pub async fn project_edit(
));
}
if !user.role.is_mod()
&& !(!project_item.inner.status.is_approved()
&& status == &ProjectStatus::Processing
|| project_item.inner.status.is_approved()
&& status.can_be_requested())
{
return Err(ApiError::CustomAuthentication(
"You don't have permission to set this status!"
.to_string(),
));
}
if status == &ProjectStatus::Processing {
if project_item.versions.is_empty() {
return Err(ApiError::InvalidInput(String::from(
@@ -499,15 +511,6 @@ pub async fn project_edit(
}
}
if (status.is_approved() || !status.can_be_requested())
&& !user.role.is_mod()
{
return Err(ApiError::CustomAuthentication(
"You don't have permission to set this status!"
.to_string(),
));
}
if status.is_approved()
&& !project_item.inner.status.is_approved()
{