Fix permission denied for checking if confirmed

This commit is contained in:
Aaron Lee 2021-10-12 16:36:40 +08:00
parent 466288dff2
commit 672110aee1

View file

@ -240,7 +240,7 @@ def group_teach_publish():
"Absent").child(date).child(period).update({i[3]: int(i[0])}, session['token']) "Absent").child(date).child(period).update({i[3]: int(i[0])}, session['token'])
for h in cclass['homerooms']: for h in cclass['homerooms']:
h = h.split('^') h = h.split('^')
if "confirm" in db.child("Homerooms").child(h[0]).child(h[1]).child("Absent").child(date).get().val(): if "confirm" in db.child("Homerooms").child(h[0]).child(h[1]).child("Absent").child(date).get(session['token']).val():
continue continue
db.child("Homerooms").child(h[0]).child(h[1]).child( db.child("Homerooms").child(h[0]).child(h[1]).child(
"Absent").child(date).child(period).child("signature").update({cclass['class_id']: str(storage.child(os.path.join('signatures', rand)).get_url(None))}, session['token']) "Absent").child(date).child(period).child("signature").update({cclass['class_id']: str(storage.child(os.path.join('signatures', rand)).get_url(None))}, session['token'])
@ -271,7 +271,7 @@ def homeroom_abs_publish():
signature = request.form['signatureData'] signature = request.form['signatureData']
formData = request.form.to_dict() formData = request.form.to_dict()
notes = "" notes = ""
if "confirm" in db.child("Homerooms").child(homeroom[0]).child(homeroom[1]).child("Absent").child(date).get().val(): if "confirm" in db.child("Homerooms").child(homeroom[0]).child(homeroom[1]).child("Absent").child(date).get(session['token']).val():
return redirect('/manage') return redirect('/manage')
if 'notes' in request.form: if 'notes' in request.form:
notes = request.form['notes'] notes = request.form['notes']