make is_active, is_authenticated, and is_anonymous properties on the Anonymous class so that the login_required decorator will work correctly and disable anonymous browsing

This commit is contained in:
Cory Sitko
2017-10-10 10:18:28 -04:00
parent 366bf9739b
commit 7ade2ecd35
6 changed files with 26 additions and 23 deletions
+2 -2
View File
@@ -42,7 +42,7 @@
{% if g.user.kindle_mail and g.user.is_authenticated %}
<a href="{{url_for('send_to_kindle', book_id=entry.id)}}" id="sendbtn" class="btn btn-primary" role="button"><span class="glyphicon glyphicon-send"></span> {{_('Send to Kindle')}}</a>
{% endif %}
{% if (g.user.role_download() and g.user.is_anonymous()) or g.user.is_authenticated %}
{% if (g.user.role_download() and g.user.is_anonymous) or g.user.is_authenticated %}
<div class="btn-group" role="group">
<button id="read-in-browser" type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="glyphicon glyphicon-eye-open"></span> {{_('Read in browser')}}
@@ -157,7 +157,7 @@
</p>
</div>
{% endif %}
{% if not g.user.is_anonymous() %}
{% if not g.user.is_anonymous %}
<div class="custom_columns">
<p>