diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2021-03-05 22:35:02 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2021-03-05 22:35:02 +0100 |
| commit | e1cd664c663b960c600a9e4a2f3f11fddbbb4dc8 (patch) | |
| tree | fd616f01b1e489477ed75206cef0e583de81e69b /animism-align/cli/app/controllers/user_controller.py | |
| parent | 501f0ab74ea7d8b1ee0d5ea4cdc84d200fa04d35 (diff) | |
user pages
Diffstat (limited to 'animism-align/cli/app/controllers/user_controller.py')
| -rw-r--r-- | animism-align/cli/app/controllers/user_controller.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/animism-align/cli/app/controllers/user_controller.py b/animism-align/cli/app/controllers/user_controller.py index 8d14b98..54b39ab 100644 --- a/animism-align/cli/app/controllers/user_controller.py +++ b/animism-align/cli/app/controllers/user_controller.py @@ -5,6 +5,7 @@ from werkzeug.datastructures import MultiDict from app.sql.common import db, Session from app.sql.models.user import User, UserForm from app.controllers.crud_controller import CrudView +from app.utils.auth_utils import encrypt_password from flask_jwt import current_identity @@ -17,6 +18,8 @@ class UserView(CrudView): raise ValueError("Unauthorized") if 'password' in form: item.password = encrypt_password(form['password']) + else: + raise ValueError("No password specified") if 'settings' in form: item.settings = form['settings'] @@ -31,7 +34,7 @@ class UserView(CrudView): if 'settings' in form: item.settings = form['settings'] - def on_destroy(self, session, form, item): + def on_destroy(self, session, item): if not current_identity.is_admin: raise ValueError("Unauthorized") if item.id == current_identity.id: |
