From ff8bf992a9048e55b58ece46cf25cc3a43edcef7 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sun, 13 May 2018 23:31:42 +0100 Subject: Add user account claiming --- app/views/githublogin.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'app/views/githublogin.py') diff --git a/app/views/githublogin.py b/app/views/githublogin.py index 875f1b2..114bb2b 100644 --- a/app/views/githublogin.py +++ b/app/views/githublogin.py @@ -43,16 +43,8 @@ def github_authorized(oauth_token): # If not logged in, log in else: if userByGithub is None: - newUser = User(username) - newUser.github_username = username - db.session.add(newUser) - db.session.commit() - - if not loginUser(newUser): - raise Exception("Unable to login as user we just created") - - flash("Created an account", "success") - return redirect(url_for("user_profile_page", username=username)) + flash("Unable to find an account for that Github user", "error") + return redirect(url_for("user_claim_page")) elif loginUser(userByGithub): return redirect(next_url or url_for("home_page")) else: -- cgit v1.2.3