diff options
author | Frederick Muriuki Muriithi | 2022-10-27 12:20:35 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2022-10-28 15:57:56 +0300 |
commit | 05628e484fb238cea6ac3267be959b2bb0702c61 (patch) | |
tree | 9fb701bc4cb8878d5a3f63d49e5f6520cb14783f /wqflask/base/trait.py | |
parent | 560eb051e127fe4b8b93104200fe55512a72038f (diff) | |
download | genenetwork2-05628e484fb238cea6ac3267be959b2bb0702c61.tar.gz |
Refactor: Pass user id to `check_resource_availability`
* Pass the user_id for the current user to the
`check_resource_availability` function as an argument, rather than
using the global `g.user_session.user_id` value.
Diffstat (limited to 'wqflask/base/trait.py')
-rw-r--r-- | wqflask/base/trait.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py index dcd81085..4352c527 100644 --- a/wqflask/base/trait.py +++ b/wqflask/base/trait.py @@ -44,9 +44,10 @@ def create_trait(**kw): if dataset.type == 'Publish': permissions = check_resource_availability( - dataset, kw.get('name')) + dataset, g.user_session.user_id, kw.get('name')) else: - permissions = check_resource_availability(dataset) + permissions = check_resource_availability( + dataset, g.user_session.user_id) if permissions['data'] != "no-access": |