Skip to content

Commit

Permalink
Disabling
Browse files Browse the repository at this point in the history
  • Loading branch information
michplunkett committed Oct 9, 2024
1 parent 04c4906 commit 464d65d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions OpenOversight/app/templates/cop_face.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{% block content %}
<div class="container theme-showcase py-5" role="main">
{% if current_user and current_user.is_authenticated %}
{% if image and not current_user.is_disabled %}
{% if image and not current_user.disabled_at and not current_user_disabled_by %}
<div class="row">
<div class="text-center">
<h1>
Expand Down Expand Up @@ -160,7 +160,7 @@ <h2>
</div>
</div>
</div>
{% elif current_user.is_disabled %}
{% elif current_user.disabled_at and current_user.disabled_by %}
<h3>Your account has been disabled due to too many incorrect classifications/tags!</h3>
<p>
<a href="mailto:[email protected]"
Expand Down
4 changes: 2 additions & 2 deletions OpenOversight/app/templates/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ <h3 class="card-title">User Statistics</h3>
role="button">Show leaderboard</a>
</p>
<h3>Account Status</h3>
{% if user.is_disabled %}
{% if user.disabled_at and user.disabled_by %}
<p>Disabled</p>
{% elif user.is_disabled == False %}
{% elif not user.disabled_at and not user.disabled_by %}
<p>Enabled</p>
{% endif %}
{% if current_user.is_administrator and not user.is_administrators %}
Expand Down
4 changes: 2 additions & 2 deletions OpenOversight/app/templates/sort.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{% block content %}
<div class="container theme-showcase py-5" role="main">
{% if current_user and current_user.is_authenticated %}
{% if image and current_user.is_disabled == False %}
{% if image and not user.disabled_at and not user.disabled_by %}
<div class="row">
<div class="text-center">
<h1>
Expand Down Expand Up @@ -70,7 +70,7 @@ <h1>
<img class="img-responsive" src="{{ path }}" alt="Picture to be sorted">
</div>
</div>
{% elif current_user.is_disabled == True %}
{% elif user.disabled_at and user.disabled_by %}
<h3>Your account has been disabled due to too many incorrect classifications/tags!</h3>
<p>
<a href="mailto:[email protected]"
Expand Down
4 changes: 3 additions & 1 deletion OpenOversight/tests/routes/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,9 @@ def test_user_can_get_email_reset_token_sent_with_password(client, session, fake
def test_user_can_change_email_with_valid_reset_token(client, session):
with current_app.test_request_context():
login_user(client)
user = User.query.filter_by(is_administrator=False, is_disabled=False).first()
user = User.query.filter_by(
is_administrator=False, disabled_at=None, disabled_by=None
).first()
token = user.generate_email_change_token("[email protected]")

rv = client.get(
Expand Down

0 comments on commit 464d65d

Please sign in to comment.