diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2021-03-05 23:39:43 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2021-03-05 23:39:43 +0100 |
| commit | 2167b0d496544f2ce904cd0036fdb8dd809ff7a0 (patch) | |
| tree | ee3e4cf0ce14b7305f1b163aa26b8f735aedeee6 /animism-align/cli/app/controllers/user_controller.py | |
| parent | ed7d80ba92cce20baf662c292be43fa75398b89b (diff) | |
fix longstanding bug in my crud controller
Diffstat (limited to 'animism-align/cli/app/controllers/user_controller.py')
| -rw-r--r-- | animism-align/cli/app/controllers/user_controller.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/animism-align/cli/app/controllers/user_controller.py b/animism-align/cli/app/controllers/user_controller.py index 26aa656..8fdc1f0 100644 --- a/animism-align/cli/app/controllers/user_controller.py +++ b/animism-align/cli/app/controllers/user_controller.py @@ -25,6 +25,7 @@ class UserView(CrudView): item.settings = form['settings'] def on_update(self, session, form, item): + current_user = get_jwt_identity() if not current_user['is_admin']: if item.id != current_user['id']: raise ValueError("Unauthorized") @@ -36,6 +37,7 @@ class UserView(CrudView): item.settings = form['settings'] def on_destroy(self, session, item): + current_user = get_jwt_identity() if not current_user['is_admin']: raise ValueError("Unauthorized") if item.id == current_user['id']: |
