Commit 083ac872a94059df230de3bf7e7cb8377cbf8430

Authored by hitier
1 parent 432b6596

Return period id by static string query filter

Has to be enhanced with date filter as soon as period is dated
Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
app/db_mgr.py
... ... @@ -207,5 +207,5 @@ def get_current_period():
207 207 :return: the id of the period of current day
208 208 """
209 209 # TODO: request on dates as soon as periods are dated
210   - p = Period.query.filter(Period.name == '2021').one_or_none()
211   - return 14
  210 + p = Period.query.filter((Period.name == '2021') | (Period.name == '2021_S1')).one()
  211 + return p.id
... ...