Fix error with selects when trying to add a new settings in the database init_tables

This commit is contained in:
Théophile Diot 2023-12-19 11:54:24 +00:00
parent 1dd85364d4
commit 3e51cc78f0
No known key found for this signature in database
GPG key ID: 248FEA4BAE400D06

View file

@ -431,6 +431,7 @@ class Database:
}
)
db_setting = session.query(Settings).filter_by(id=setting).first()
select_values = value.pop("select", [])
if db_setting:
updates = {}
@ -469,7 +470,6 @@ class Database:
db_selects = session.query(Selects).with_entities(Selects.value).filter_by(setting_id=value["id"]).all()
db_values = [select.value for select in db_selects]
select_values = value.pop("select", [])
missing_values = [select for select in db_values if select not in select_values]
if select_values: