From f860f57363a30eedbb20870627a9b39f5ca4a611 Mon Sep 17 00:00:00 2001 From: Geometrically <18202329+Geometrically@users.noreply.github.com> Date: Thu, 2 Jun 2022 20:56:12 -0700 Subject: [PATCH] Fix version editing (#362) --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/routes/versions.rs | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f8719adb..16f8f266 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1399,7 +1399,7 @@ dependencies = [ [[package]] name = "labrinth" -version = "2.3.1" +version = "2.4.1" dependencies = [ "actix", "actix-cors", diff --git a/Cargo.toml b/Cargo.toml index 2a23b85e..518c0870 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "labrinth" -version = "2.3.1" +version = "2.4.1" #Team members, please add your emails and usernames authors = ["geometrically ", "Redblueflame ", "Aeledfyr ", "Charalampos Fanoulis ", "AppleTheGolden "] edition = "2018" diff --git a/src/routes/versions.rs b/src/routes/versions.rs index 626886d1..5515947f 100644 --- a/src/routes/versions.rs +++ b/src/routes/versions.rs @@ -258,7 +258,9 @@ pub async fn version_edit( .fetch_one(&mut *transaction) .await?; - if results.exists.unwrap_or(true) { + if results.exists.unwrap_or(true) + && &version_item.version_number != number + { return Err(ApiError::InvalidInput( "A version with that version_number already exists" .to_string(),