You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We do quite a lot of the below around the codebase:
system=self._system_repository.get(item.system_id)
ifnotsystem:
raiseMissingRecordError(f"No system found with ID: {item.system_id}")
It might be better if we modify the definition of the get repo methods to have a parameter like raise_if_none=False and change their logic to raise MissingRecordError if True is passed for raise_if_none. This way, we can just call self._system_repository.get(item.system_id, raise_if_none=True), meaning that we will not have to repeat the same logic in a few places.
The text was updated successfully, but these errors were encountered:
We do quite a lot of the below around the codebase:
It might be better if we modify the definition of the
get
repo methods to have a parameter likeraise_if_none=False
and change their logic to raiseMissingRecordError
ifTrue
is passed forraise_if_none
. This way, we can just callself._system_repository.get(item.system_id, raise_if_none=True)
, meaning that we will not have to repeat the same logic in a few places.The text was updated successfully, but these errors were encountered: