Skip to content

Commit

Permalink
Another potential fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jayvarner committed Jul 19, 2024
1 parent 983bad8 commit 705bac4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion readux_ingest_ecds/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ def save_model(self, request, obj, form, change):
form.save_m2m()
obj.save()

ingest_files = request.FILES.getlist("volume_files")
ingest_files = request.FILES.getlist("volume_files")[0]

for ingest_file in ingest_files:
print(ingest_file)
if (
"metadata" in ingest_file.name.casefold()
and "zip" not in guess_type(ingest_file.name)[0]
Expand Down
2 changes: 1 addition & 1 deletion test_app/tests/test_bulk_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ def test_bulk_admin_save_multiple(self):
with open(bundle_file_two_path, "rb") as f:
bundle_file_two_content = files.base.ContentFile(f.read())
bundle_file_two = files.File(bundle_file_two_content.file, "volume3.zip")
data["volume_files"] = [metadata_file, bundle_file_one, bundle_file_two]

request_factory = RequestFactory()
req = request_factory.post("/admin/ingest/bulk/add/", data=data)
req.FILES["volume_files"] = [metadata_file, bundle_file_one, bundle_file_two]
req.user = self.user

bulk_model_admin = BulkAdmin(model=Bulk, admin_site=AdminSite())
Expand Down

0 comments on commit 705bac4

Please sign in to comment.