fix a few small upload bugs
This commit is contained in:
+4
-2
@@ -70,8 +70,10 @@ def upload_dicom(request, files: List[UploadedFile] = File(...)):
|
||||
except DuplicateDicom as e:
|
||||
duplicate.append((file.name, ud.image_blake3_hash))
|
||||
|
||||
duplicate_series.add(e.duplicate.get_series().get_absolute_url())
|
||||
print(duplicate_series)
|
||||
|
||||
if type(e.duplicate) == SeriesImage:
|
||||
duplicate_series.add(e.duplicate.series.get_absolute_url())
|
||||
|
||||
pass
|
||||
except InvalidDicomError:
|
||||
failed.append(file.name)
|
||||
|
||||
+3
-2
@@ -1304,8 +1304,7 @@ class UncategorisedDicom(models.Model):
|
||||
try:
|
||||
self.series_instance_uid = ds["SeriesInstanceUID"].value
|
||||
except AttributeError:
|
||||
# ? only called with invalid dicom?
|
||||
self.series_instance_uid = ds["SeriesInstanceUID"]
|
||||
raise InvalidDicomError("Invalid dicom file")
|
||||
|
||||
# if self.check_for_duplicates():
|
||||
# return DuplicateDicom
|
||||
@@ -1333,6 +1332,8 @@ class UncategorisedDicom(models.Model):
|
||||
ds = pydicom.dcmread(self.image)
|
||||
return ds
|
||||
except pydicom.errors.InvalidDicomError:
|
||||
print("Error getting dicom dataset")
|
||||
print(self.image)
|
||||
return {"SeriesInstanceUID": "1234"}
|
||||
|
||||
def get_basic_dicom_tags(self, dataset=None):
|
||||
|
||||
Reference in New Issue
Block a user