Skip to content
This repository has been archived by the owner on May 1, 2023. It is now read-only.

Commit

Permalink
Fix for new flask-login
Browse files Browse the repository at this point in the history
  • Loading branch information
svenstaro committed Dec 17, 2015
1 parent 23f3293 commit cc5036c
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions flamejam/templates/account/profile.html
Expand Up @@ -10,9 +10,9 @@ <h1>
{% if user.real_name %}<small>{{ user.real_name }}</small>{% endif %}

<div class="pull-right">
{% if current_user.is_authenticated() and current_user == user %}
{% if current_user.is_authenticated and current_user == user %}
<a href="{{ url_for('settings') }}" class="btn btn-primary">Profile settings</a>
{% elif current_user.is_authenticated() %}
{% elif current_user.is_authenticated %}
{% if user.pm_mode == "form" %}
<a href="{{ url_for('contact_user', username = user.username) }}" class="btn">Send mail</a>
{% elif user.pm_mode == "email" %}
Expand Down
2 changes: 1 addition & 1 deletion flamejam/templates/base.html
Expand Up @@ -45,7 +45,7 @@
</div>

<div class="btn-group">
{% if current_user.is_anonymous() %}
{% if current_user.is_anonymous %}
<a href="{{ url_for('login') }}" class="btn btn-small">Login / Signup</a>
{% else %}
{% if current_user.invitiation %}
Expand Down
2 changes: 1 addition & 1 deletion flamejam/templates/jam/base.html
Expand Up @@ -27,7 +27,7 @@
{% endif %}
{% endmacro %}

{% set p = current_user.getParticipation(jam) if current_user.is_authenticated() else None %}
{% set p = current_user.getParticipation(jam) if current_user.is_authenticated else None %}

<ul class="menu">
{{ jamMenu("jam_info", "Overview") }}
Expand Down
10 changes: 5 additions & 5 deletions flamejam/templates/jam/game/info.html
Expand Up @@ -11,9 +11,9 @@ <h1>

<div class="pull-right">

{% if current_user.is_authenticated() and current_user.inTeam(game.team) %}
{% if current_user.is_authenticated and current_user.inTeam(game.team) %}
<a href="{{ url_for('edit_game', jam_slug = game.jam.slug, game_id = game.id) }}" class="btn btn-primary btn-normal pull-right">Edit game</a>
{% elif current_user.is_authenticated() and jam.getStatus().code == 4 and not rating and current_user in jam.participants %}
{% elif current_user.is_authenticated and jam.getStatus().code == 4 and not rating and current_user in jam.participants %}
<a href="{{ url_for('rate_game', jam_slug = jam.slug, game_id = game.id) }}" class="btn btn-primary">Rate Game</a>
{% endif %}
</div>
Expand Down Expand Up @@ -55,7 +55,7 @@ <h2>Download</h2>
</ul>
{% else %}
<p>There are no packages available yet.</p>
{% if current_user.is_authenticated() and current_user in game.team.members %}
{% if current_user.is_authenticated and current_user in game.team.members %}
<a href="{{ url_for('edit_game', jam_slug = game.jam.slug, game_id = game.id) }}" class="btn btn-mini">Upload a package</a>
{% endif %}
{% endif %}
Expand Down Expand Up @@ -129,7 +129,7 @@ <h2>Feedback</h2>
<td>{{ rating.text or "&mdash;" | safe }}</td>
</tr>
<tr><td colspan="{{ cols }}" style="text-align: center;"><a href="{{ url_for('rate_game', jam_slug = jam.slug, game_id = game.id) }}" class="btn btn-small">Edit my Rating</a></td></tr>
{% elif current_user.is_authenticated() %}
{% elif current_user.is_authenticated %}
<tr><td colspan="{{ cols }}" style="text-align: center;"><a href="{{ url_for('rate_game', jam_slug = jam.slug, game_id = game.id) }}" class="btn btn-small">Rate Game</a></td></tr>
{% else %}
<tr><td colspan="{{ cols }}" style="text-align: center;">Please
Expand Down Expand Up @@ -177,7 +177,7 @@ <h2>Comments</h2>
<p>No comments yet.</p>
{% endif %}

{% if current_user.is_authenticated() %}
{% if current_user.is_authenticated %}
<form method="POST">
{{ form_errors(form) }}
{{ form.hidden_tag() }}
Expand Down
2 changes: 1 addition & 1 deletion flamejam/templates/jam/games.html
Expand Up @@ -58,7 +58,7 @@ <h1>Games</h1>
<tbody>
{% for game in games %}
{% if jam.getStatus().code > 3 %}
{% set rating = current_user.ratings.filter_by(game = game).first() if current_user.is_authenticated() else None %}
{% set rating = current_user.ratings.filter_by(game = game).first() if current_user.is_authenticated else None %}
{% endif %}
{% if rating %}
<tr class="success">
Expand Down
2 changes: 1 addition & 1 deletion flamejam/templates/jam/info.html
Expand Up @@ -9,7 +9,7 @@ <h1>
<small>{{ ("Theme: \"" + jam.theme + "\"") if jam.showTheme else "Theme not announced" }}</small>

{% if jam.getStatus().code >= 1 %}
{% set r = current_user.getParticipation(jam) if current_user.is_authenticated() else None %}
{% set r = current_user.getParticipation(jam) if current_user.is_authenticated else None %}
<div class="pull-right">
{% if r %}
<span style="font-size: 8pt; vertical-align: middle; margin-right: 10px;">
Expand Down
4 changes: 2 additions & 2 deletions flamejam/templates/jam/team/info.html
Expand Up @@ -9,7 +9,7 @@ <h1>
<small style="margin-right: 20px;">for {{ jam.title }}</small>

<div class="pull-right">
{% if current_user.is_authenticated() and current_user.inTeam(team) %}
{% if current_user.is_authenticated and current_user.inTeam(team) %}
{% if team.canInvite(current_user) %}
<a href="{{ url_for('team_settings', jam_slug = team.jam.slug) }}" class="btn btn-normal">Invite a member</a>
{% elif team.jam.team_limit > 1 %}
Expand Down Expand Up @@ -76,7 +76,7 @@ <h2>Users in this team</h2>
{% endfor %}
</table>

{% if current_user.is_authenticated() and current_user in team.members %}
{% if current_user.is_authenticated and current_user in team.members %}
<p><b>Note:</b> You can invite users from the <a href="{{ url_for('team_settings', jam_slug = team.jam.slug) }}">team settings</a> page.</p>
{% endif %}
</div>
Expand Down
2 changes: 1 addition & 1 deletion flamejam/views/account.py
Expand Up @@ -82,7 +82,7 @@ def on_identity_loaded(sender, identity):

@app.route('/reset', methods=['GET', 'POST'])
def reset_request():
if current_user.is_authenticated():
if current_user.is_authenticated:
flash("You are already logged in.", "info")
return redirect(url_for("index"))
error = None
Expand Down
2 changes: 1 addition & 1 deletion flamejam/views/game.py
Expand Up @@ -127,7 +127,7 @@ def show_game(jam_slug, game_id):
jam = Jam.query.filter_by(slug = jam_slug).first_or_404()
game = Game.query.filter_by(is_deleted = False, id = game_id).filter_by(jam = jam).first_or_404()

if current_user.is_authenticated() and comment_form.validate_on_submit():
if current_user.is_authenticated and comment_form.validate_on_submit():
comment = Comment(comment_form.text.data, game, current_user)
db.session.add(comment)
db.session.commit()
Expand Down

0 comments on commit cc5036c

Please sign in to comment.