Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/api/deposit_status.py
Show All 34 Lines | def get(self, req, collection_name, deposit_id, format=None): | ||||
req, NOT_FOUND, | req, NOT_FOUND, | ||||
'deposit %s does not belong to collection %s' % ( | 'deposit %s does not belong to collection %s' % ( | ||||
deposit_id, collection_name)) | deposit_id, collection_name)) | ||||
status_detail = convert_status_detail(deposit.status_detail) | status_detail = convert_status_detail(deposit.status_detail) | ||||
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_id_context': None, | ||||
'swh_anchor_id': None, | 'swh_anchor_id': None, | ||||
'swh_anchor_id_context': None, | 'swh_anchor_id_context': None, | ||||
'external_id': 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: | if deposit.swh_id_context: | ||||
context['swh_id_context'] = deposit.swh_id_context | context['swh_id_context'] = deposit.swh_id_context | ||||
if deposit.swh_anchor_id: | if deposit.swh_anchor_id: | ||||
context['swh_anchor_id'] = deposit.swh_anchor_id | context['swh_anchor_id'] = deposit.swh_anchor_id | ||||
if deposit.swh_anchor_id_context: | if deposit.swh_anchor_id_context: | ||||
context['swh_anchor_id_context'] = deposit.swh_anchor_id_context | context['swh_anchor_id_context'] = deposit.swh_anchor_id_context | ||||
if deposit.external_id: | |||||
context['external_id'] = deposit.external_id | |||||
douardda: Shouldn't this be the time to think about something like:
```
context = {
'deposit_id'… | |||||
ardumontAuthorUnsubmitted Done Inline Actionssure ardumont: sure | |||||
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) |
Shouldn't this be the time to think about something like:
?