mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'shandley/char-deletion-fix' into 'master'
Ensure that the player uuid and character id both match in a character deletion query See merge request veloren/veloren!1027
This commit is contained in:
commit
df5f09de14
@ -144,7 +144,12 @@ pub fn create_character(
|
||||
pub fn delete_character(uuid: &str, character_id: i32, db_dir: &str) -> CharacterListResult {
|
||||
use schema::character::dsl::*;
|
||||
|
||||
diesel::delete(character.filter(id.eq(character_id))).execute(&establish_connection(db_dir))?;
|
||||
diesel::delete(
|
||||
character
|
||||
.filter(id.eq(character_id))
|
||||
.filter(player_uuid.eq(uuid)),
|
||||
)
|
||||
.execute(&establish_connection(db_dir))?;
|
||||
|
||||
load_character_list(uuid, db_dir)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user