diff --git a/server/routes.py b/server/routes.py index 0060ab3..97030bd 100644 --- a/server/routes.py +++ b/server/routes.py @@ -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,7 +106,8 @@ def deleteAccount(): if not current_user.is_authenticated: return redirect(url_for('account')) # TODO fix google delete account - google.deleteAccount(current_user) + if current_user.google_token != None: + google.deleteAccount(current_user) ''' for cal in current_user.calendars: db.session.delete(cal) @@ -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()