diff --git a/swh/deposit/api/deposit_status.py b/swh/deposit/api/deposit_status.py
--- a/swh/deposit/api/deposit_status.py
+++ b/swh/deposit/api/deposit_status.py
@@ -42,22 +42,12 @@
context = {
'deposit_id': deposit.id,
- 'status': deposit.status,
'status_detail': status_detail,
- 'swh_id': None,
- 'swh_id_context': None,
- 'swh_anchor_id': None,
- 'swh_anchor_id_context': None,
}
-
- if 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
+ keys = ('status', 'swh_id', 'swh_id_context', 'swh_anchor_id',
+ 'swh_anchor_id_context', 'external_id')
+ for k in keys:
+ context[k] = getattr(deposit, k, None)
return render(req, 'deposit/status.xml',
context=context,
diff --git a/swh/deposit/cli/deposit.py b/swh/deposit/cli/deposit.py
--- a/swh/deposit/cli/deposit.py
+++ b/swh/deposit/cli/deposit.py
@@ -23,11 +23,11 @@
pass
-def generate_slug(prefix='swh-sample'):
+def generate_slug():
"""Generate a slug (sample purposes).
"""
- return '%s-%s' % (prefix, uuid.uuid4())
+ return str(uuid.uuid4())
def client_command_parse_input(
diff --git a/swh/deposit/client/__init__.py b/swh/deposit/client/__init__.py
--- a/swh/deposit/client/__init__.py
+++ b/swh/deposit/client/__init__.py
@@ -350,7 +350,9 @@
'deposit_swh_id',
'deposit_swh_id_context',
'deposit_swh_anchor_id',
- 'deposit_swh_anchor_id_context'])
+ 'deposit_swh_anchor_id_context',
+ 'deposit_external_id',
+ ])
class BaseCreateDepositClient(BaseDepositClient):
diff --git a/swh/deposit/templates/deposit/status.xml b/swh/deposit/templates/deposit/status.xml
--- a/swh/deposit/templates/deposit/status.xml
+++ b/swh/deposit/templates/deposit/status.xml
@@ -8,4 +8,5 @@
{% if swh_id_context is not None %}{{ swh_id_context }}{% endif %}
{% if swh_anchor_id is not None %}{{ swh_anchor_id }}{% endif %}
{% if swh_anchor_id_context is not None %}{{ swh_anchor_id_context }}{% endif %}
+ {% if external_id is not None %}{{ external_id }}{% endif %}
diff --git a/swh/deposit/tests/api/test_deposit_status.py b/swh/deposit/tests/api/test_deposit_status.py
--- a/swh/deposit/tests/api/test_deposit_status.py
+++ b/swh/deposit/tests/api/test_deposit_status.py
@@ -64,6 +64,7 @@
self.assertEqual(r['deposit_status'], DEPOSIT_STATUS_DEPOSITED)
self.assertEqual(r['deposit_status_detail'],
DEPOSIT_STATUS_DETAIL[DEPOSIT_STATUS_DEPOSITED])
+ self.assertEqual(r['deposit_external_id'], external_id)
def test_status_with_swh_information(self):
_status = DEPOSIT_STATUS_LOAD_SUCCESS