about summary refs log tree commit diff
path: root/uploader/phenotypes/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'uploader/phenotypes/views.py')
-rw-r--r--uploader/phenotypes/views.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/uploader/phenotypes/views.py b/uploader/phenotypes/views.py
index 23bc682..c03f3f5 100644
--- a/uploader/phenotypes/views.py
+++ b/uploader/phenotypes/views.py
@@ -317,6 +317,11 @@ def create_dataset(species: dict, population: dict, **kwargs):# pylint: disable=
         dataset_shortname = (
             form["dataset-shortname"] or form["dataset-name"]).strip()
         _pheno_dataset = save_new_dataset(
+            # It's not necessary to update the authorisation server to register
+            # new phenotype resource here, since each phenotype trait can, in
+            # theory, have its own access control allowing/disallowing access to
+            # it. In practice, however, we tend to gather multiple traits into a
+            # single resource for access control.
             cursor,
             population["Id"],
             form["dataset-name"].strip(),
@@ -662,6 +667,8 @@ def review_job_data(
                                        conn, int(_job_metadata["publicationid"]))
                                    if _job_metadata.get("publicationid")
                                    else None),
+                               user=session.user_details(),
+                               timestamp=datetime.datetime.now().isoformat(),
                                activelink="add-phenotypes")
 
 
@@ -741,9 +748,15 @@ def load_data_to_database(
                     "publication_id": _meta["publicationid"],
                     "authserver": oauth2client.authserver_uri(),
                     "token": token["access_token"],
+                    "dataname": request.form["data_name"].strip(),
                     "success_handler": (
                         "uploader.phenotypes.views"
-                        ".load_phenotypes_success_handler")
+                        ".load_phenotypes_success_handler"),
+                    **{
+                        key: request.form[key]
+                        for key in ("data_description",)
+                        if key in request.form.keys()
+                    }
                 },
                 external_id=session.logged_in_user_id())
         ).then(