fixed: has_primary_key_set was always set to false in Model::insert()

and this prevented to insert a model which had a primary key set by hand
This commit is contained in:
Tomasz Sowa 2021-05-21 22:36:04 +02:00
parent e0e3465673
commit 2f72bd29ec
1 changed files with 1 additions and 2 deletions

View File

@ -408,8 +408,7 @@ bool Model::insert(ModelData * model_data, bool insert_whole_tree)
bool Model::insert_tree(bool insert_whole_tree)
{
bool result = false;
has_primary_key_set = false; // the key will be overwritten (the database will create a new key)
model_env->has_primary_key_set = false;
model_env->has_primary_key_set = has_primary_key_set;
if( insert_whole_tree )
{