aboutsummaryrefslogtreecommitdiff
path: root/gn3/auth/authorisation
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-12-08 08:09:40 +0300
committerFrederick Muriuki Muriithi2022-12-08 08:35:42 +0300
commit836924e7dccddaceb036fe3a312ca6811ccf2228 (patch)
treeb73fc2bdeac3fa4508d5219580965c0b9aa132a8 /gn3/auth/authorisation
parentb2e4621ba69a4fbbb9bd310aae6c9dee7339a3f5 (diff)
downloadgenenetwork3-836924e7dccddaceb036fe3a312ca6811ccf2228.tar.gz
tests: Fix issues caught by tests
The addition of the `public` field in the `resources` table, led to some previously passing tests to fail. This commit fixes the failures, and cleans up some pylint issues. * gn3/auth/authorisation/resources.py: add `public` to db queries * tests/unit/auth/test_groups.py: fix pylint issues
Diffstat (limited to 'gn3/auth/authorisation')
-rw-r--r--gn3/auth/authorisation/resources.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/gn3/auth/authorisation/resources.py b/gn3/auth/authorisation/resources.py
index 2ddd865..095a72c 100644
--- a/gn3/auth/authorisation/resources.py
+++ b/gn3/auth/authorisation/resources.py
@@ -34,12 +34,13 @@ def create_resource(
if not group:
raise MissingGroupError(
"User with no group cannot create a resource.")
- resource = Resource(group, uuid4(), resource_name, resource_category)
+ resource = Resource(group, uuid4(), resource_name, resource_category, False)
cursor.execute(
- ("INSERT INTO resources VALUES (?, ?, ?, ?)"),
+ "INSERT INTO resources VALUES (?, ?, ?, ?, ?)",
(str(resource.group.group_id), str(resource.resource_id),
resource_name,
- str(resource.resource_category.resource_category_id)))
+ str(resource.resource_category.resource_category_id),
+ 1 if resource.public else 0))
return resource