-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finish audit fields for
users
table (#1129)
## Fixes issue #1004 ## Description of Changes Added `disabled_by`, `disabled_at`, `approved_at`, `approved_by`, and `confirmed_at`, and `confirmed_by` fields to the `users` table so that we could keep track of users actions on the platform at a more granular level. I also removed the previously mentioned columns corresponding boolean columns. ## Tests and Linting - [x] This branch is up-to-date with the `develop` branch. - [x] `pytest` passes on my local development environment. - [x] `pre-commit` passes on my local development environment. - [x] The `flask db upgrade` and `flask db downgrade` functions work for both migrations. ```console I have no name!@c38d30934aa7:/usr/src/app$ % (env) michaelp@MacBook-Air-18 OpenOversight % docker exec -it openoversight-web-1 bash I have no name!@5027495d31c0:/usr/src/app$ flask db downgrade ... INFO [alembic.runtime.migration] Running downgrade 99c50fc8d294 -> bf254c0961ca, complete audit field addition to users I have no name!@5027495d31c0:/usr/src/app$ flask db downgrade ... INFO [alembic.runtime.migration] Running downgrade bf254c0961ca -> 5865f488470c, add remaining audit fields for users table I have no name!@5027495d31c0:/usr/src/app$ flask db downgrade ... INFO [alembic.runtime.migration] Running downgrade 5865f488470c -> 939ea0f2b26d, change salary column types I have no name!@5027495d31c0:/usr/src/app$ flask db upgrade ... INFO [alembic.runtime.migration] Running upgrade 939ea0f2b26d -> 5865f488470c, change salary column types INFO [alembic.runtime.migration] Running upgrade 5865f488470c -> bf254c0961ca, add remaining audit fields for users table INFO [alembic.runtime.migration] Running upgrade bf254c0961ca -> 99c50fc8d294, complete audit field addition to users I have no name!@5027495d31c0:/usr/src/app$ ```
- Loading branch information
1 parent
b47d7e4
commit 0097663
Showing
14 changed files
with
508 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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> | ||
|
@@ -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]" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 current_user.disabled_at and not current_user.disabled_by %} | ||
<div class="row"> | ||
<div class="text-center"> | ||
<h1> | ||
|
@@ -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 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]" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.