Skip to content

Commit b37f0e7

Browse files
authored
List kinds compatible with batch add cases form (#4338)
1 parent fda9bd2 commit b37f0e7

4 files changed

Lines changed: 9 additions & 8 deletions

File tree

app/grandchallenge/archives/forms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ class AddCasesForm(UploadRawImagesForm):
198198
forward=[
199199
"model_name",
200200
"object_slug",
201-
forward.Const(True, "image_only"),
201+
forward.Const(True, "batch_upload_only"),
202202
],
203203
attrs={
204204
"data-placeholder": "Search for a socket ...",
@@ -223,7 +223,7 @@ def __init__(self, *args, base_obj, interface_viewname, **kwargs):
223223
qs = (
224224
ComponentInterface.objects.all()
225225
.filter(
226-
kind__in=InterfaceKinds.image,
226+
kind__in=InterfaceKinds.panimg,
227227
**socket_filter_kwargs,
228228
)
229229
.order_by("title")

app/grandchallenge/components/views.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class ComponentInterfaceAutocomplete(
114114
def get_queryset(self):
115115
object_slug = self.forwarded.pop("object_slug")
116116
model_name = self.forwarded.pop("model_name")
117-
image_only = self.forwarded.pop("image_only", False)
117+
batch_upload_only = self.forwarded.pop("batch_upload_only", False)
118118

119119
if model_name == ReaderStudy._meta.model_name:
120120
obj = ReaderStudy.objects.get(slug=object_slug)
@@ -130,9 +130,9 @@ def get_queryset(self):
130130
except AttributeError:
131131
extra_filter_kwargs = {}
132132

133-
if image_only:
133+
if batch_upload_only:
134134
qs = ComponentInterface.objects.filter(
135-
kind__in=InterfaceKinds.image,
135+
kind__in=InterfaceKinds.panimg,
136136
**extra_filter_kwargs,
137137
)
138138
else:

app/grandchallenge/hanging_protocols/forms.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ def _get_interface_lists(self):
209209
*InterfaceKinds.undisplayable,
210210
*InterfaceKinds.mandatory_isolation,
211211
InterfaceKindChoices.PANIMG_IMAGE,
212+
InterfaceKindChoices.DICOM_IMAGE_SET,
212213
)
213214
]
214215
return InterfaceLists(

app/tests/components_tests/test_views.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def test_component_interface_autocomplete(client):
8080
{
8181
"object_slug": rs.slug,
8282
"model_name": ReaderStudy._meta.model_name,
83-
"image_only": True,
83+
"batch_upload_only": True,
8484
}
8585
)
8686
},
@@ -101,7 +101,7 @@ def test_component_interface_autocomplete(client):
101101
{
102102
"object_slug": rs.slug,
103103
"model_name": ReaderStudy._meta.model_name,
104-
"image_only": True,
104+
"batch_upload_only": True,
105105
}
106106
),
107107
},
@@ -217,7 +217,7 @@ def test_ci_autocomplete_for_archives(client):
217217
{
218218
"object_slug": archive.slug,
219219
"model_name": Archive._meta.model_name,
220-
"image_only": True,
220+
"batch_upload_only": True,
221221
}
222222
)
223223
},

0 commit comments

Comments
 (0)