about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--gn_auth/auth/authorisation/resources/common.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/gn_auth/auth/authorisation/resources/common.py b/gn_auth/auth/authorisation/resources/common.py
index 5a48704..fd358f1 100644
--- a/gn_auth/auth/authorisation/resources/common.py
+++ b/gn_auth/auth/authorisation/resources/common.py
@@ -42,6 +42,7 @@ def grant_access_to_sysadmins(
 
     cursor.executemany(
         "INSERT INTO user_roles(user_id, role_id, resource_id) "
-        "VALUES (?, ?, ?)",
+        "VALUES (?, ?, ?) "
+        "ON CONFLICT (user_id, role_id, resource_id) DO NOTHING",
         tuple((row["user_id"], sysadminroleid, str(resource_id))
               for row in cursor.fetchall()))