Fix not deleting old user issue

This commit is contained in:
Aaron Lee 2021-11-01 19:14:32 +08:00
parent 17c722c9c7
commit a355887755
2 changed files with 1 additions and 3 deletions

3
app.py
View file

@ -69,7 +69,6 @@ def index():
@app.route('/select', methods=['GET', 'POST'])
def selSubUser():
if check_login_status():
print(session)
session.clear()
flash("Timeout. 遇時,請重新登入")
return redirect('/')
@ -130,7 +129,6 @@ def chgPassword():
old['token'] = oldUsr['idToken']
data = db.child("Users").child(
oldUsr['localId']).get(oldUsr['idToken']).val()
print("data:", data, flush=True)
auth.delete_user_account(oldUsr['idToken'])
delUser = True
@ -139,6 +137,7 @@ def chgPassword():
request.form['new_username'], request.form['new_password'])
db.child("Users").child(newUsr['localId']).set(
data, newUsr['idToken'])
db.child("Users").child(oldUsr['localId']).remove(oldUsr['idToken'])
session.clear()
flash(
'修改密碼成功,請重新登入<br>Password changed successfully. Please login again.')

View file

@ -105,7 +105,6 @@ def upload_gp_classes():
csv_dict.columns[i+1]: tmp_csv[j],
"type": 'group'
}, session['token'])
accs.remove(allUsers[key]['origUsername'])
os.remove(filepath)
except Exception as e:
os.remove(filepath)