Compare commits

...

4 commits

Author SHA1 Message Date
Dryusdan 6d31d8e256 Merge tag 'holiday_weekday_update' into develop
Merge
2022-07-03 15:38:52 +02:00
Dryusdan e3d3c319de Merge branch 'hotfix/holiday_weekday_update' 2022-07-03 15:38:36 +02:00
Dryusdan 64bc5076d7 Correct update 2022-07-03 15:38:30 +02:00
Dryusdan a09d665e18 Add boucles updater and remove logging settings
Reviewed-on: #1
2022-07-03 15:03:22 +02:00

View file

@ -58,9 +58,9 @@ def get_comptage_by_date_and_boucle(date, id_boucle, unaccounted_table):
def update_comptage(comptage: schemas.ComptageBase, unaccounted_table):
with Session() as session:
if unaccounted_table:
stmt = update(models.unaccounted_Comptage).where(models.unaccounted_Comptage.id == comptage.id).values(count=comptage.count)
stmt = update(models.unaccounted_Comptage).where(models.unaccounted_Comptage.id == comptage.id).values(holiday=comptage.holiday, week_day=comptage.week_day, count=comptage.count)
else:
stmt = update(models.Comptage).where(models.Comptage.id == comptage.id).values(count=comptage.count)
stmt = update(models.Comptage).where(models.Comptage.id == comptage.id).values(holiday=comptage.holiday, week_day=comptage.week_day, count=comptage.count)
session.execute(stmt)
session.commit()
return True