diff --git a/wildlifecompliance/management/securebase_manager.py b/wildlifecompliance/management/securebase_manager.py index 4407f3848..5db820072 100644 --- a/wildlifecompliance/management/securebase_manager.py +++ b/wildlifecompliance/management/securebase_manager.py @@ -294,8 +294,8 @@ def get_http_response_for_wildlifelicensing(self): self.validate_request_for_wildlifelicence(licence) document = licence.licence_document mime = mimetypes.guess_type(document._file.name)[0] - - if document and document.extension == ".heic": + extension = document._file.name.split(".")[-1] + if extension.lower() == "heic": mime = "image/heic" response = HttpResponse(content_type=mime) response.write(document._file.read())