diff options
| author | rubenwardy <rw@rubenwardy.com> | 2018-05-13 23:31:42 +0100 |
|---|---|---|
| committer | rubenwardy <rw@rubenwardy.com> | 2018-05-13 23:33:05 +0100 |
| commit | ff8bf992a9048e55b58ece46cf25cc3a43edcef7 (patch) | |
| tree | 02a1a7198a9fd20539465a0ccd378f0dd02f8913 /app/views/githublogin.py | |
| parent | 31615da169766087a35c104d6aa8797a6eaa7594 (diff) | |
| download | cheatdb-ff8bf992a9048e55b58ece46cf25cc3a43edcef7.tar.xz | |
Add user account claiming
Diffstat (limited to 'app/views/githublogin.py')
| -rw-r--r-- | app/views/githublogin.py | 12 |
1 files changed, 2 insertions, 10 deletions
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: |
