Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/grandchallenge/cases/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,17 @@ def __init__(
)
super().__init__(widgets, attrs)

def decompress(self, value):
def decompress(self, value): # noqa: C901
if not value:
return [None, None]

if isinstance(value, (list, tuple)):
if len(value) == 1:
item = value[0]
if item == "":
return [None, None]
if not item:
raise RuntimeError("Unexpected value")
Comment thread
koopmant marked this conversation as resolved.
if item in ImageWidgetChoices.names:
return [None, None]
if Image.objects.filter(pk=item).exists():
Expand Down
Loading