From 05332bb76899d410eb12773f3388499a2ce35620 Mon Sep 17 00:00:00 2001 From: Aaron Lee Date: Sun, 3 Oct 2021 18:00:15 +0800 Subject: [PATCH] Change date access according to the format --- upload.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/upload.py b/upload.py index fdf1da4..b6369e7 100644 --- a/upload.py +++ b/upload.py @@ -242,15 +242,14 @@ def upload_dates(): temp = db.child("Homerooms").get(session['token']).val() for row in csv_dict: for h in headers: - h = h.replace('/', '-') for t in temp: for i in temp[t]: periodData = db.child("Classes").child( "Homeroom").child(t).child(i).get(session['token']).val() db.child("Homerooms").child(t).child(i).child( - "Absent").child(h).update({"dow": row[h.replace('-', '/')]}, session['token']) + "Absent").child(h).update({"dow": row[h]}, session['token']) db.child("Homerooms").child(t).child(i).child( - "Absent").child(h).update(periodData[int(row[h.replace('-', '/')])], session['token']) + "Absent").child(h).update(periodData[int(row[h])], session['token']) os.remove(filepath) except Exception as e: os.remove(filepath)