Skip to content

Commit

Permalink
Fixed problem with upload of MRXS files creating also the DAT files.
Browse files Browse the repository at this point in the history
  • Loading branch information
maubreville committed Dec 9, 2024
1 parent 8b0f5b2 commit 3fe0274
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions exact/exact/images/api_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,9 @@ def create(self, request):
os.remove(os.path.join(imageset.root_path(), zipname))
filenames = [f.filename for f in zip_ref.filelist]
filenames.sort()
# remove mrxs dat files
if any(".mrxs" in f for f in filenames):
filenames = [name for name in filenames if ".mrxs" in name]
duplicat_count = 0
for filename in filenames:
file_path = os.path.join(imageset.root_path(), filename)
Expand All @@ -416,10 +419,13 @@ def create(self, request):
fchecksum.update(buf)
fchecksum = fchecksum.digest()



# check if vms is in any images then just save the vms files
# else for each jpg a new image will be created in the databse
if any(".vms" in f for f in filenames) and ".vms" in filename:
file_list[file_path] = fchecksum

elif(any(".vms" in f for f in filenames) == False):
file_list[file_path] = fchecksum
except IsADirectoryError:
Expand Down

0 comments on commit 3fe0274

Please sign in to comment.