Skip to content

Commit cbb0e2e

Browse files
feat: logs in api_retrieve_materials_blob() (ietf-tools#9818)
1 parent 145b9f7 commit cbb0e2e

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

ietf/meeting/views.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ def _default_content_type(blob_name: str):
451451
else:
452452
# found the blob - return it
453453
assert isinstance(blob, BlobFile)
454+
log(f"Materials blob: directly returning {bucket}:{name}")
454455
return FileResponse(
455456
blob,
456457
filename=name,
@@ -473,17 +474,20 @@ def _default_content_type(blob_name: str):
473474
if doc.type_id != bucket:
474475
raise Document.DoesNotExist
475476
except Document.DoesNotExist:
477+
log(f"Materials blob: no doc for {bucket}:{name}")
476478
return HttpResponseNotFound(
477479
f"Document corresponding to {bucket}:{name} not found."
478480
)
479481
else:
480482
# create all missing blobs for the doc while we're at it
483+
log(f"Materials blob: storing blobs for {doc.name}-{doc.rev}")
481484
store_blobs_for_one_material_doc(doc)
482485

483486
# If we can make the blob at all, it now exists, so return it or a 404
484487
try:
485488
blob = storage.open(name, "rb")
486489
except FileNotFoundError:
490+
log(f"Materials blob: no blob for {bucket}:{name}")
487491
return HttpResponseNotFound(f"Object {bucket}:{name} not found.")
488492
else:
489493
# found the blob - return it

0 commit comments

Comments
 (0)