1
0

Fix user deletion (#907)

* Fix user deletion

* run prep+fmt

* Update validators
This commit is contained in:
Geometrically
2024-04-22 17:46:56 -07:00
committed by GitHub
parent 83ccf4928f
commit 49cf0c8a9a
6 changed files with 98 additions and 7 deletions

View File

@@ -877,7 +877,9 @@ pub async fn upload_file(
}
let data = data.freeze();
let primary = (version_files.iter().all(|x| !x.primary) && !ignore_primary)
let primary = (validation_result.is_passed()
&& version_files.iter().all(|x| !x.primary)
&& !ignore_primary)
|| force_primary
|| total_files_len == 1;
@@ -911,6 +913,12 @@ pub async fn upload_file(
));
}
if let ValidationResult::Warning(msg) = validation_result {
if primary {
return Err(CreateError::InvalidInput(msg.to_string()));
}
}
version_files.push(VersionFileBuilder {
filename: file_name.to_string(),
url: format!("{cdn_url}/{file_path_encode}"),