mirror of
https://github.com/aaronleetw/Attendance.git
synced 2024-11-14 11:01: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'])
|
||||
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.')
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue