diff --git a/onadata/apps/logger/models/instance.py b/onadata/apps/logger/models/instance.py index 4b3ca0a515..c4a07e81b7 100644 --- a/onadata/apps/logger/models/instance.py +++ b/onadata/apps/logger/models/instance.py @@ -66,7 +66,7 @@ def get_attachment_url(attachment, suffix=None): def _get_attachments_from_instance(instance): attachments = [] - for a in instance.attachments.all(): + for a in instance.attachments.filter(deleted_at__isnull=True): attachment = dict() attachment['download_url'] = get_attachment_url(a) attachment['small_download_url'] = get_attachment_url(a, 'small')