clear_old_meetings.py 403 B

1234567891011
  1. from dateutil.parser import parse
  2. from app.data_provider import delete_meeting_and_notifications
  3. from app.dates import is_actual_date
  4. from app.db import fetchall
  5. meetings = fetchall("meetings", ["id", "meeting_datetime"])
  6. if type(meetings) == dict: meetings = [meetings]
  7. for m in meetings:
  8. if not is_actual_date(parse(m["meeting_datetime"])):
  9. delete_meeting_and_notifications(m["id"], 555)