Skip to content

Commit 142f798

Browse files
committed
These are probably the last ones
1 parent 690ed7a commit 142f798

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/endpoints/mod_versions.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,9 @@ pub async fn create_version(
298298
return Err(e);
299299
}
300300

301-
if dev.verified {
301+
let accepted_count = ModVersion::get_accepted_count(&json.id, &mut transaction).await?;
302+
303+
if dev.verified && accepted_count > 0 {
302304
send_webhook(
303305
json.id.clone(),
304306
json.name.clone(),
@@ -322,7 +324,7 @@ pub async fn create_version(
322324
.await
323325
.or(Err(ApiError::TransactionError))?;
324326

325-
if !dev.verified {
327+
if !dev.verified || accepted_count == 0 {
326328
tokio::spawn(async move {
327329
let m = fetched_mod.unwrap();
328330
let v_res = ModVersion::get_one(&path.id, &json.version, true, false, &mut pool).await;

src/forum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ pub async fn create_or_update_thread(
308308
format!(" by {}", admin.unwrap().display_name)
309309
} else {
310310
"".to_string()
311-
}, if v.info.is_some() {
311+
}, if v.info.is_some() && !v.info.clone().unwrap().is_empty() {
312312
format!(": `{}`", v.info.clone().unwrap())
313313
} else {
314314
"".to_string()

0 commit comments

Comments
 (0)