mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Ensure that the player uuid and character id both match in a character deletion query.
This commit is contained in:
parent
8667d5a815
commit
84d0332c6d
@ -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