From eb8780e9f9cef1f9c2e5f015e3b5755e3bbe33e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mats=20Paul=20Ton=C4=8Dik?= Date: Tue, 30 Jun 2026 08:23:42 +0200 Subject: [PATCH] Added openalex institution id for predefined organizations --- service/src/data/predefined_accounts.json | 6 +++--- service/src/main/inse/auth/service.py | 11 ++++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/service/src/data/predefined_accounts.json b/service/src/data/predefined_accounts.json index b6bf36da..9bd44c0c 100644 --- a/service/src/data/predefined_accounts.json +++ b/service/src/data/predefined_accounts.json @@ -6,15 +6,15 @@ }, { "name": "Universität Duisburg-Essen", - "openalex_instution_id": "https://openalex.org/I62318514" + "openalex_institution_id": "I62318514" }, { "name": "Ruhr-Universität Bochum", - "openalex_instution_id": "https://openalex.org/I904495901" + "openalex_institution_id": "I904495901" }, { "name": "TU Dortmund", - "openalex_instution_id": "https://openalex.org/I200332995" + "openalex_institution_id": "I200332995" } ], "accounts": [ diff --git a/service/src/main/inse/auth/service.py b/service/src/main/inse/auth/service.py index ff9e518f..3c24086e 100644 --- a/service/src/main/inse/auth/service.py +++ b/service/src/main/inse/auth/service.py @@ -87,7 +87,16 @@ def create_predefined_accounts(session: Session, file_path: str): if organization_id is not None: organization_id = uuid.UUID(organization_id) organization_name = organization_data["name"] - organization = Organization(id=organization_id, name=organization_name) + openalex_institution_id = organization_data.get( + "openalex_institution_id" + ) + if openalex_institution_id is not None: + openalex_institution_id = str(openalex_institution_id) + organization = Organization( + id=organization_id, + name=organization_name, + openalex_institution_id=openalex_institution_id, + ) session.add(organization) for account_data in data.get("accounts", []): organization_id = uuid.UUID(account_data["organization_id"])