diff --git a/local_db/data_access.py b/local_db/data_access.py index dce5dd48..bcccf062 100644 --- a/local_db/data_access.py +++ b/local_db/data_access.py @@ -192,14 +192,13 @@ def delete_file_from_request( audit: AuditEvent, ): with transaction.atomic(): - # TODO: needs fixing when RETURNED lands - # # defense in depth - # request = self._find_metadata(request_id) - # - # assert ( - # request.status == RequestStatus.PENDING - # or request.status == RequestFileType.RETURNED - # ) + # defense in depth + request = self._find_metadata(request_id) + + assert ( + request.status == RequestStatus.PENDING + or request.status == RequestStatus.RETURNED + ) try: request_file = RequestFileMetadata.objects.get(