From c013aa66ed949a4f346f99b91f7e491d367fffc5 Mon Sep 17 00:00:00 2001 From: amickan Date: Wed, 18 Dec 2024 15:42:23 +0100 Subject: [PATCH] Update default_interface property --- app/grandchallenge/algorithms/models.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/grandchallenge/algorithms/models.py b/app/grandchallenge/algorithms/models.py index 8fcc880a5..8e3680c40 100644 --- a/app/grandchallenge/algorithms/models.py +++ b/app/grandchallenge/algorithms/models.py @@ -517,12 +517,12 @@ def default_interface(self): try: return self.interfaces.get() except MultipleObjectsReturned: - try: - return self.interfaces.get( - algorithmalgorithminterface__is_default=True - ) - except ObjectDoesNotExist: - return None + return self.interfaces.get( + algorithmalgorithminterface__is_default=True + ) + except ObjectDoesNotExist: + # this is the case for newly created algorithms + return None def is_editor(self, user): return user.groups.filter(pk=self.editors_group.pk).exists()