Skip to content

Commit

Permalink
Merge branch 'feature/icat-to-panosc-data-model-conversion-#265' of g…
Browse files Browse the repository at this point in the history
…ithub.com:ral-facilities/datagateway-api into feature/icat-to-panosc-data-model-conversion-#265
  • Loading branch information
VKTB committed Jan 28, 2022
2 parents 0bbcc0d + 299cbcd commit 3f463fb
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions datagateway_api/src/search_api/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import abc
from abc import ABC
from abc import ABC, abstractmethod
from datetime import datetime, timezone
import sys
from typing import ClassVar, List, Optional, Union
Expand Down Expand Up @@ -34,7 +33,7 @@ def _get_icat_field_value(icat_field_name, icat_data):

class PaNOSCAttribute(ABC, BaseModel):
@classmethod
@abc.abstractmethod
@abstractmethod
def from_icat(cls, icat_data, required_related_fields): # noqa: B902, N805
model_fields = cls.__fields__

Expand All @@ -55,9 +54,8 @@ def from_icat(cls, icat_data, required_related_fields): # noqa: B902, N805
field_value = None
for field_name in icat_field_name:
try:
value = _get_icat_field_value(field_name, icat_data)
if value:
field_value = value
field_value = _get_icat_field_value(field_name, icat_data)
if field_value:
break
except KeyError:
continue
Expand Down

0 comments on commit 3f463fb

Please sign in to comment.