Skip to content

Commit

Permalink
Address review
Browse files Browse the repository at this point in the history
  • Loading branch information
amickan committed Dec 12, 2024
1 parent 1d2ddce commit 9a08b1b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/grandchallenge/algorithms/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -1409,18 +1409,18 @@ def save(self):
algorithm=self._algorithm
).update(is_default=False)

if AlgorithmAlgorithmInterface.objects.filter(
matched_rows = AlgorithmAlgorithmInterface.objects.filter(
algorithm=self._algorithm, interface=interface
).exists():
AlgorithmAlgorithmInterface.objects.filter(
algorithm=self._algorithm, interface=interface
).update(is_default=self.cleaned_data["set_as_default"])
else:
).update(is_default=self.cleaned_data["set_as_default"])

if matched_rows == 0:
self._algorithm.interfaces.add(
interface,
through_defaults={
"is_default": self.cleaned_data["set_as_default"]
},
)
elif matched_rows > 1:
raise RuntimeError("This _really_ shouldn't happen")

return interface

0 comments on commit 9a08b1b

Please sign in to comment.