Skip to content

Commit 0d79e0a

Browse files
committed
fix issue with organization identifier types.
set version 0.3.9 Signed-off-by: Neal Ensor <ensorn@osti.gov>
1 parent a475edd commit 0d79e0a

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,5 @@
6565
- StatsReviewer
6666
- Translator
6767

68+
## 0.3.9 - 1/17/2025
69+
- fix issue with Organization identifiers and allowed types

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "elinkapi"
7-
version = "0.3.8"
7+
version = "0.3.9"
88
authors = [
99
{ name="Jacob Samar", email="samarj@osti.gov" },
1010
{ name="Neal Ensor", email="ensorn@osti.gov" }

src/elinkapi/organization.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ def validate_ror_id(cls, value: str) -> str:
5757
Add an identifier to this Organization.
5858
"""
5959
def add(self, item: Identifier):
60-
if self.type is not None and self.type != Organization.Type.SPONSOR:
60+
if self.type is not None and self.type != Organization.Type.SPONSOR.value:
6161
raise ValueError ("Only sponsoring organizations may specify identifiers.")
6262

63-
if item.type not in [Identifier.Type.AWARD_DOI, Identifier.Type.CONTRACT_NUMBER, Identifier.Type.DOE_CONTRACT_NUMBER]:
64-
raise ValueError ("Organization identifier type is not allowed.")
63+
if item.type not in [Identifier.Type.AWARD_DOI.value, Identifier.Type.CONTRACT_NUMBER.value, Identifier.Type.DOE_CONTRACT_NUMBER.value]:
64+
raise ValueError ("Identifier type not allowed as Organization identifier.")
6565

6666
if self.identifiers is None:
6767
self.identifiers=[]

0 commit comments

Comments
 (0)