Changeset View
Changeset View
Standalone View
Standalone View
swh/web/admin/deposit.py
Show First 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | try: | ||||
table_data["recordsFiltered"] = len(deposits) | table_data["recordsFiltered"] = len(deposits) | ||||
table_data["data"] = [ | table_data["data"] = [ | ||||
{ | { | ||||
"id": d["id"], | "id": d["id"], | ||||
"external_id": d["external_id"], | "external_id": d["external_id"], | ||||
"reception_date": d["reception_date"], | "reception_date": d["reception_date"], | ||||
"status": d["status"], | "status": d["status"], | ||||
"status_detail": d["status_detail"], | "status_detail": d["status_detail"], | ||||
"swh_anchor_id": d["swh_anchor_id"], | |||||
"swh_anchor_id_context": d["swh_anchor_id_context"], | |||||
"swh_id": d["swh_id"], | "swh_id": d["swh_id"], | ||||
"swh_id_context": d["swh_id_context"], | "swh_id_context": d["swh_id_context"], | ||||
} | } | ||||
for d in data | for d in data | ||||
] | ] | ||||
except Exception as exc: | except Exception as exc: | ||||
sentry_sdk.capture_exception(exc) | sentry_sdk.capture_exception(exc) | ||||
table_data["error"] = ( | table_data["error"] = ( | ||||
"An error occurred while retrieving " "the list of deposits !" | "An error occurred while retrieving " "the list of deposits !" | ||||
) | ) | ||||
return HttpResponse(json.dumps(table_data), content_type="application/json") | return HttpResponse(json.dumps(table_data), content_type="application/json") |