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,7 +884,9 @@ 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!(
|
||||
"
|
||||
SELECT EXISTS(SELECT 1 FROM mods WHERE slug = LOWER($1))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user