about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--scripts/load_phenotypes_to_db.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/load_phenotypes_to_db.py b/scripts/load_phenotypes_to_db.py
index 8855c4c..c1a7687 100644
--- a/scripts/load_phenotypes_to_db.py
+++ b/scripts/load_phenotypes_to_db.py
@@ -313,10 +313,18 @@ def update_auth(# pylint: disable=[too-many-locals,too-many-positional-arguments
             }).then(lambda attc: (user, linkeddata, resource, attc))
 
     def __handle_error__(resp):
+        error = resp.json()
+        if error.get("error") == "IntegrityError":
+            # This is hacky. If the auth already exists, something went wrong
+            # somewhere.
+            # This needs investigation to recover correctly.
+            logger.info(
+                "The authorisation for the data was already set up.")
+            return 0
         logger.error("ERROR: Updating the authorisation for the data failed.")
         logger.debug(
             "ERROR: The response from the authorisation server was:\n\t%s",
-            resp.json())
+            error)
         return 1
 
     def __handle_success__(_val):