EOX GitLab Instance

Skip to content
Snippets Groups Projects
Commit 0186e0d3 authored by Fabian Schindler's avatar Fabian Schindler
Browse files

Make EOxServer ItemBackend conformant to the new ABC

parent 0346d6fc
No related branches found
No related tags found
1 merge request!15Registration routes
Pipeline #26255 passed
......@@ -60,7 +60,7 @@ class ItemToProductTypeMapping(TypedDict):
collections: List[str]
class EOxServerBackend(Backend["Item"]):
class ItemBackend(Backend["Item"]):
"""
EOxServer backend allows registration to be performed on a running
EOxServer instance
......@@ -337,7 +337,7 @@ class EOxServerBackend(Backend["Item"]):
return product
@transaction.atomic
def register_item(self, source: Optional[Source], item: "Item", replace: bool):
def register(self, source: Optional[Source], item: "Item", replace: bool):
"""Registers the item to the endpoint
Args:
......@@ -396,8 +396,13 @@ class EOxServerBackend(Backend["Item"]):
else:
raise RegistrationError(f"{item} not matched to any product_type")
def deregister(self, source: Optional[Source], item: "Item"):
""" Defers to ``deregister_identifier`` with the items identifier
"""
return self.deregister_identifier(item.id)
@transaction.atomic
def deregister_identifier(self, identifier: str) -> Optional[str]:
def deregister_identifier(self, identifier: str):
"""Attempts to deregister item
Args:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment