mirror of
https://github.com/aaronleetw/Attendance.git
synced 2024-11-14 19:11:39 -08:00
Fix not deleting old user issue
This commit is contained in:
parent
17c722c9c7
commit
a355887755
2 changed files with 1 additions and 3 deletions
3
app.py
3
app.py
|
@ -69,7 +69,6 @@ def index():
|
||||||
@app.route('/select', methods=['GET', 'POST'])
|
@app.route('/select', methods=['GET', 'POST'])
|
||||||
def selSubUser():
|
def selSubUser():
|
||||||
if check_login_status():
|
if check_login_status():
|
||||||
print(session)
|
|
||||||
session.clear()
|
session.clear()
|
||||||
flash("Timeout. 遇時,請重新登入")
|
flash("Timeout. 遇時,請重新登入")
|
||||||
return redirect('/')
|
return redirect('/')
|
||||||
|
@ -130,7 +129,6 @@ def chgPassword():
|
||||||
old['token'] = oldUsr['idToken']
|
old['token'] = oldUsr['idToken']
|
||||||
data = db.child("Users").child(
|
data = db.child("Users").child(
|
||||||
oldUsr['localId']).get(oldUsr['idToken']).val()
|
oldUsr['localId']).get(oldUsr['idToken']).val()
|
||||||
print("data:", data, flush=True)
|
|
||||||
|
|
||||||
auth.delete_user_account(oldUsr['idToken'])
|
auth.delete_user_account(oldUsr['idToken'])
|
||||||
delUser = True
|
delUser = True
|
||||||
|
@ -139,6 +137,7 @@ def chgPassword():
|
||||||
request.form['new_username'], request.form['new_password'])
|
request.form['new_username'], request.form['new_password'])
|
||||||
db.child("Users").child(newUsr['localId']).set(
|
db.child("Users").child(newUsr['localId']).set(
|
||||||
data, newUsr['idToken'])
|
data, newUsr['idToken'])
|
||||||
|
db.child("Users").child(oldUsr['localId']).remove(oldUsr['idToken'])
|
||||||
session.clear()
|
session.clear()
|
||||||
flash(
|
flash(
|
||||||
'修改密碼成功,請重新登入<br>Password changed successfully. Please login again.')
|
'修改密碼成功,請重新登入<br>Password changed successfully. Please login again.')
|
||||||
|
|
|
@ -105,7 +105,6 @@ def upload_gp_classes():
|
||||||
csv_dict.columns[i+1]: tmp_csv[j],
|
csv_dict.columns[i+1]: tmp_csv[j],
|
||||||
"type": 'group'
|
"type": 'group'
|
||||||
}, session['token'])
|
}, session['token'])
|
||||||
accs.remove(allUsers[key]['origUsername'])
|
|
||||||
os.remove(filepath)
|
os.remove(filepath)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
os.remove(filepath)
|
os.remove(filepath)
|
||||||
|
|
Loading…
Reference in a new issue