diff options
author | Frederick Muriuki Muriithi | 2023-05-25 06:02:38 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2023-05-25 06:18:25 +0300 |
commit | 8593d882ed1eea226eeefabaa66135df2374746f (patch) | |
tree | 972d233da4b6fa9238263277b579880e0862aeaa /gn3/auth/authorisation/resources/views.py | |
parent | 5f9f4ff97c27a0f34a86eec516ab3f58faf5937e (diff) | |
download | genenetwork3-8593d882ed1eea226eeefabaa66135df2374746f.tar.gz |
Set whether resource is publicly viewable on creation
Diffstat (limited to 'gn3/auth/authorisation/resources/views.py')
-rw-r--r-- | gn3/auth/authorisation/resources/views.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gn3/auth/authorisation/resources/views.py b/gn3/auth/authorisation/resources/views.py index c8bff6a..396a57e 100644 --- a/gn3/auth/authorisation/resources/views.py +++ b/gn3/auth/authorisation/resources/views.py @@ -47,9 +47,11 @@ def create_resource() -> Response: with db.connection(db_uri) as conn: try: resource = _create_resource( - conn, resource_name, resource_category_by_id( - conn, resource_category_id), - the_token.user) + conn, + resource_name, + resource_category_by_id(conn, resource_category_id), + the_token.user, + (form.get("public") == "on")) return jsonify(dictify(resource)) except sqlite3.IntegrityError as sql3ie: if sql3ie.args[0] == ("UNIQUE constraint failed: " |