Skip to content

Commit

Permalink
Fix failing test case for duplicate submissions with altered attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
rajpatel24 committed Oct 17, 2024
1 parent b18f4a5 commit 362bfa8
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions kobo/apps/openrosa/libs/utils/logger_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
default_kobocat_storage as default_storage,
)
from kpi.utils.object_permission import get_database_user
from kpi.utils.hash import calculate_hash
from kpi.utils.mongo_helper import MongoHelper

OPEN_ROSA_VERSION_HEADER = 'X-OpenRosa-Version'
Expand Down Expand Up @@ -668,9 +667,7 @@ def save_attachments(
media_file=attachment_filename,
mimetype=f.content_type,
).first()
if existing_attachment and (
existing_attachment.file_hash == calculate_hash(f.read())
):
if existing_attachment:
# We already have this attachment!
continue
f.seek(0)
Expand Down

0 comments on commit 362bfa8

Please sign in to comment.