Fix version editing (#362)

This commit is contained in:
Geometrically
2022-06-02 20:56:12 -07:00
committed by GitHub
parent 02bf5ada89
commit f860f57363
3 changed files with 5 additions and 3 deletions

2
Cargo.lock generated
View File

@@ -1399,7 +1399,7 @@ dependencies = [
[[package]]
name = "labrinth"
version = "2.3.1"
version = "2.4.1"
dependencies = [
"actix",
"actix-cors",

View File

@@ -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 <jai.a@tuta.io>", "Redblueflame <contact@redblueflame.com>", "Aeledfyr <aeledfyr@gmail.com>", "Charalampos Fanoulis <yo@fanoulis.dev>", "AppleTheGolden <scotsbox@protonmail.com>"]
edition = "2018"

View File

@@ -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(),