Make last_check a function parameter.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Tue, 17 Dec 2019 20:19:11 +0000 (20:19 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Tue, 17 Dec 2019 20:19:11 +0000 (20:19 +0000)
git-svn-id: http://www.winterrodeln.org/svn/wrpylib/trunk@2859 7aebc617-e5e2-0310-91dc-80fb5f6d2477

wrpylib/wrintermaps.py

index 53269dd37e72875fa1c8a0561f70177d0472370e..0f303e69a4a7b64a4c6f5be2ea1e7289f8673674 100644 (file)
@@ -83,7 +83,7 @@ def update_wrintermapssledrun(session, json_content: dict):
     session.commit()
 
 
-def update_wrintermapsreport(session, json_content: dict):
+def update_wrintermapsreport(session, json_content: dict, last_check: datetime.datetime):
     # add current content of intermaps_report to intermaps_history
     pass
 
@@ -103,7 +103,7 @@ def update_wrintermapsreport(session, json_content: dict):
         report.intermaps_sledrun_id = sledrun.intermaps_sledrun_id
         report.status = sledrun_json['status']
         report.last_update = region['lastUpdate']
-        report.last_check = datetime.datetime.now()
+        report.last_check = last_check
         report.utc_offset = 1
         session.add(report)
     session.commit()
@@ -118,4 +118,4 @@ if __name__ == '__main__':
         content = json.load(fp)
     session = Session()
     update_wrintermapssledrun(session, content)
-    update_wrintermapsreport(session, content)
+    update_wrintermapsreport(session, content, datetime.datetime.now())