Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/api/deposit_status.py
Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | def get(self, req, collection_name, deposit_id, format=None): | ||||
if not status_detail: | if not status_detail: | ||||
status_detail = DEPOSIT_STATUS_DETAIL[deposit.status] | status_detail = DEPOSIT_STATUS_DETAIL[deposit.status] | ||||
context = { | context = { | ||||
'deposit_id': deposit.id, | 'deposit_id': deposit.id, | ||||
'status': deposit.status, | 'status': deposit.status, | ||||
'status_detail': status_detail, | 'status_detail': status_detail, | ||||
'swh_id': None, | 'swh_id': None, | ||||
'swh_id_context': None, | |||||
'swh_anchor_id': None, | |||||
'swh_anchor_id_context': None, | |||||
} | } | ||||
if deposit.swh_id: | if deposit.swh_id: | ||||
context['swh_id'] = deposit.swh_id | context['swh_id'] = deposit.swh_id | ||||
if deposit.swh_id_context: | |||||
context['swh_id_context'] = deposit.swh_id_context | |||||
if deposit.swh_anchor_id: | |||||
context['swh_anchor_id'] = deposit.swh_anchor_id | |||||
if deposit.swh_anchor_id_context: | |||||
context['swh_anchor_id_context'] = deposit.swh_anchor_id_context | |||||
return render(req, 'deposit/status.xml', | return render(req, 'deposit/status.xml', | ||||
context=context, | context=context, | ||||
content_type='application/xml', | content_type='application/xml', | ||||
status=status.HTTP_200_OK) | status=status.HTTP_200_OK) |