Skip to content

Commit

Permalink
Closes webcompat#32. Force re-login on GitHubError.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Taylor committed Mar 31, 2014
1 parent cb02076 commit d3676ad
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions webcompat/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from flask import (flash, g, redirect, request, render_template, session,
url_for)
from flask.ext.github import GitHubError
from datetime import datetime
from issue_form import build_formdata, IssueForm
from models import db_session, User
Expand Down Expand Up @@ -120,6 +121,13 @@ def about():
return render_template('about.html')


@app.errorhandler(GitHubError)
def jumpship():
session.pop('user_id', None)
flash('Something bad happened. Please try again?', 'error')
return redirect(url_for('index'))


@app.errorhandler(404)
def not_found(err):
return render_template('404.html'), 404

0 comments on commit d3676ad

Please sign in to comment.