fixes account deletion without google user
This commit is contained in:
parent
722db5feae
commit
5d1edbc6fc
@ -91,7 +91,7 @@ def register():
|
||||
return redirect(url_for('account'))
|
||||
form = RegistrationForm()
|
||||
if form.validate_on_submit():
|
||||
user = User(id=form.username.data,
|
||||
user = User(userid=form.username.data,
|
||||
username=form.username.data,
|
||||
email=form.email.data)
|
||||
user.setPassword(form.password.data)
|
||||
@ -106,6 +106,7 @@ def deleteAccount():
|
||||
if not current_user.is_authenticated:
|
||||
return redirect(url_for('account'))
|
||||
# TODO fix google delete account
|
||||
if current_user.google_token != None:
|
||||
google.deleteAccount(current_user)
|
||||
'''
|
||||
for cal in current_user.calendars:
|
||||
@ -122,7 +123,7 @@ def deleteAccount():
|
||||
|
||||
@app.route("/login/google")
|
||||
def googlelogin():
|
||||
if current_user.is_authenticated and current_user.google_credentials.refresh_token != None:
|
||||
if current_user.is_authenticated and current_user.google_token.refresh_token != None:
|
||||
return redirect(url_for('account'))
|
||||
|
||||
authorization_url = google.login()
|
||||
|
Loading…
Reference in New Issue
Block a user