diff --git a/nmdc_runtime/api/main.py b/nmdc_runtime/api/main.py index 71a6863e..6db86c98 100644 --- a/nmdc_runtime/api/main.py +++ b/nmdc_runtime/api/main.py @@ -249,7 +249,7 @@ def ensure_initial_resources_on_boot(): ).model_dump(exclude_unset=True), upsert=True, ) - mdb.users.create_index("username") + mdb.users.create_index("username", unique=True) site_id = os.getenv("API_SITE_ID") runtime_site_ok = mdb.sites.count_documents(({"id": site_id})) > 0