Fixed an issue with colliding slugs when modifying a project (#562)
* Fixed an issue with colliding slugs when modifying a project * Update projects.rs --------- Co-authored-by: triphora <emma@modrinth.com>
This commit is contained in:
parent
630a71c46c
commit
0271337f8e
@ -884,9 +884,11 @@ pub async fn project_edit(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
// Make sure the new slug is different from the old one
|
||||||
|
// We are able to unwrap here because the slug is always set
|
||||||
|
if !slug.eq(&project_item.inner.slug.unwrap_or_default()) {
|
||||||
let results = sqlx::query!(
|
let results = sqlx::query!(
|
||||||
"
|
"
|
||||||
SELECT EXISTS(SELECT 1 FROM mods WHERE slug = LOWER($1))
|
SELECT EXISTS(SELECT 1 FROM mods WHERE slug = LOWER($1))
|
||||||
",
|
",
|
||||||
slug
|
slug
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user