Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed breaking changes introduced by Flask-Login 0.3.0 #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions fbone/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

@api.route('/login', methods=['POST'])
def login():
if current_user.is_authenticated():
if current_user.is_authenticated:
return jsonify(flag='success')

username = request.form.get('username')
Expand All @@ -28,6 +28,6 @@ def login():

@api.route('/logout')
def logout():
if current_user.is_authenticated():
if current_user.is_authenticated:
logout_user()
return jsonify(flag='success', msg='Logouted.')
12 changes: 6 additions & 6 deletions fbone/frontend/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
@frontend.route('/login/openid', methods=['GET', 'POST'])
@oid.loginhandler
def login_openid():
if current_user.is_authenticated():
if current_user.is_authenticated:
return redirect(url_for('user.index'))

form = OpenIDForm()
Expand All @@ -43,7 +43,7 @@ def create_or_login(resp):

@frontend.route('/create_profile', methods=['GET', 'POST'])
def create_profile():
if current_user.is_authenticated():
if current_user.is_authenticated:
return redirect(url_for('user.index'))

form = CreateProfileForm(name=request.args.get('name'),
Expand All @@ -66,7 +66,7 @@ def create_profile():
def index():
current_app.logger.debug('debug')

if current_user.is_authenticated():
if current_user.is_authenticated:
return redirect(url_for('user.index'))

page = int(request.args.get('page', 1))
Expand All @@ -88,7 +88,7 @@ def search():

@frontend.route('/login', methods=['GET', 'POST'])
def login():
if current_user.is_authenticated():
if current_user.is_authenticated:
return redirect(url_for('user.index'))

form = LoginForm(login=request.args.get('login', None),
Expand Down Expand Up @@ -137,7 +137,7 @@ def logout():

@frontend.route('/signup', methods=['GET', 'POST'])
def signup():
if current_user.is_authenticated():
if current_user.is_authenticated:
return redirect(url_for('user.index'))

form = SignupForm(next=request.args.get('next'))
Expand All @@ -159,7 +159,7 @@ def signup():
@frontend.route('/change_password', methods=['GET', 'POST'])
def change_password():
user = None
if current_user.is_authenticated():
if current_user.is_authenticated:
if not login_fresh():
return login_manager.needs_refresh()
user = current_user
Expand Down
Empty file modified fbone/static/css/bootstrap.css
100755 → 100644
Empty file.
Empty file modified fbone/static/css/bootstrap.css.map
100755 → 100644
Empty file.
Empty file modified fbone/static/css/main.css
100755 → 100644
Empty file.
Empty file modified fbone/static/css/normalize.css
100755 → 100644
Empty file.
Empty file modified fbone/static/js/vendor/jquery-1.10.2.min.js
100755 → 100644
Empty file.
Empty file modified fbone/static/js/vendor/modernizr-2.6.2.min.js
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion fbone/templates/layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<li><a href='http://imwilsonxu.com'>Blog</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
{% if current_user.is_authenticated() %}
{% if current_user.is_authenticated %}
{% if current_user.is_admin() %}
<li><a href="{{ url_for('admin.index') }}">{{ current_user.name }}</a></li>
{% else %}
Expand Down
2 changes: 1 addition & 1 deletion fbone/user/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@user.route('/')
@login_required
def index():
if not current_user.is_authenticated():
if not current_user.is_authenticated:
abort(403)
return render_template('user/index.html', user=current_user)

Expand Down