chore(dao): Replace save/overwrite with create/update respectively (#24467)

This commit is contained in:
John Bodley
2023-08-11 12:55:39 -07:00
committed by GitHub
parent a3d72e0ec7
commit ed0d288ccd
22 changed files with 196 additions and 194 deletions

View File

@@ -42,11 +42,10 @@ class CreateAnnotationCommand(BaseCommand):
def run(self) -> Model:
self.validate()
try:
annotation = AnnotationDAO.create(self._properties)
return AnnotationDAO.create(attributes=self._properties)
except DAOCreateFailedError as ex:
logger.exception(ex.exception)
raise AnnotationCreateFailedError() from ex
return annotation
def validate(self) -> None:
exceptions: list[ValidationError] = []

View File

@@ -39,11 +39,10 @@ class CreateAnnotationLayerCommand(BaseCommand):
def run(self) -> Model:
self.validate()
try:
annotation_layer = AnnotationLayerDAO.create(self._properties)
return AnnotationLayerDAO.create(attributes=self._properties)
except DAOCreateFailedError as ex:
logger.exception(ex.exception)
raise AnnotationLayerCreateFailedError() from ex
return annotation_layer
def validate(self) -> None:
exceptions: list[ValidationError] = []