Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/api/collection.py
Show First 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | class CollectionAPI(APIPost): | ||||
def _deposit_create( | def _deposit_create( | ||||
self, request, collection_name: str, external_id: Optional[str] | self, request, collection_name: str, external_id: Optional[str] | ||||
) -> Deposit: | ) -> Deposit: | ||||
collection = get_collection_by_name(collection_name) | collection = get_collection_by_name(collection_name) | ||||
client = self.get_client(request) | client = self.get_client(request) | ||||
deposit_parent: Optional[Deposit] = None | deposit_parent: Optional[Deposit] = None | ||||
if external_id: | if external_id: | ||||
# TODO: delete this when clients stopped relying on the slug | |||||
ardumont: So as far as i could tell, for now, we keep the retro-compatibilty, right? | |||||
Done Inline Actionsyes vlorentz: yes | |||||
try: | try: | ||||
# find a deposit parent (same external id, status load to success) | # find a deposit parent (same external id, status load to success) | ||||
deposit_parent = ( | deposit_parent = ( | ||||
Deposit.objects.filter( | Deposit.objects.filter( | ||||
client=client, | client=client, | ||||
external_id=external_id, | external_id=external_id, | ||||
status=DEPOSIT_STATUS_LOAD_SUCCESS, | status=DEPOSIT_STATUS_LOAD_SUCCESS, | ||||
) | ) | ||||
Show All 13 Lines |
So as far as i could tell, for now, we keep the retro-compatibilty, right?