Skip to content

Commit

Permalink
fix: use alternative ICAT mapping for Technique pid when pid is None #…
Browse files Browse the repository at this point in the history
  • Loading branch information
VKTB committed Feb 10, 2022
1 parent 7640e8d commit bf1c830
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions datagateway_api/src/search_api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,10 @@ class Technique(PaNOSCAttribute):

datasets: Optional[List[Dataset]] = []

@validator("pid", pre=True, always=True)
def set_pid(cls, value): # noqa: B902, N805
return f"pid:{value}" if isinstance(value, int) else value

@classmethod
def from_icat(cls, icat_data, required_related_fields):
return super(Technique, cls).from_icat(icat_data, required_related_fields)
Expand Down

0 comments on commit bf1c830

Please sign in to comment.