Skip to content

Commit

Permalink
Apply suggestions from code review #265
Browse files Browse the repository at this point in the history
Co-authored-by: Matthew Richards <32678030+MRichards99@users.noreply.github.com>
  • Loading branch information
VKTB and MRichards99 authored Jan 28, 2022
1 parent 7f4cd96 commit 299cbcd
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 @@ -33,7 +32,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 @@ -54,9 +53,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 299cbcd

Please sign in to comment.