From 53b5207e5bc335f1c581a712cddb11bb249d01d5 Mon Sep 17 00:00:00 2001 From: Karl Burke Date: Wed, 18 Jan 2023 09:20:35 -0500 Subject: [PATCH 1/2] file_worker.py --- src/uuid_worker.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/uuid_worker.py b/src/uuid_worker.py index 0e27b25..5ae1c39 100644 --- a/src/uuid_worker.py +++ b/src/uuid_worker.py @@ -1,3 +1,4 @@ +from datetime import datetime, timezone import logging import mysql.connector.errors @@ -611,7 +612,9 @@ def newUUIDs(self, parentIDs, entityType, userId, userEmail, nIds, organ_code=No # if entityType == 'DONOR': gen_base_ids = entityType in ID_ENTITY_TYPES returnIds = [] - now = time.strftime('%Y-%m-%d %H:%M:%S') + # See admonition at https://docs.python.org/3/library/datetime.html#datetime.datetime.utcnow to + # retrieve a non-naive UTC time. + awareUTCTimeNow = datetime.now(timezone.utc) store_file_info = False if entityType == 'FILE': store_file_info = True @@ -673,7 +676,7 @@ def newUUIDs(self, parentIDs, entityType, userId, userEmail, nIds, organ_code=No # insRow = (insUuid, ins_app_base_id, entityType, now, userId, userEmail) # Only set the attributes tuple of committing attributes to the table besides the UUID - insertVals.append((insUuid, entityType, now, userId, userEmail)) + insertVals.append((insUuid, entityType, awareUTCTimeNow, userId, userEmail)) if insert_attributes_for_uuid: insertAttribVals.append((insUuid, ins_app_base_id, submission_ids[n] if gen_submission_ids else None)) From 4f4b1d746836391dae97d871b7af3734c4b4d117 Mon Sep 17 00:00:00 2001 From: Karl Burke Date: Wed, 18 Jan 2023 13:38:21 -0500 Subject: [PATCH 2/2] Reference correct file name and fix typo. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 511d28b..4da9e57 100644 --- a/README.md +++ b/README.md @@ -66,4 +66,4 @@ cd hubmap-docker ### Updating API Documentation -The documentation for the API calls is hosted on SmartAPI. Modifying the `files-api-spec.yaml` file and commititng the changes to github should update the API shown on SmartAPI. SmartAPI allows users to register API documents. The documentation is associated with this github account: api-developers@hubmapconsortium.org. +The documentation for the API calls is hosted on SmartAPI. Modifying the `uuid-api-spec.yaml` file and committing the changes to GitHub should update the API shown on SmartAPI. SmartAPI allows users to register API documents. The documentation is associated with this GitHub account: api-developers@hubmapconsortium.org.