From 65b4a254188d0247a7a0bba9f5c9170ebf222918 Mon Sep 17 00:00:00 2001 From: amickan Date: Thu, 12 Dec 2024 11:04:26 +0100 Subject: [PATCH] Remove default interface link from admin --- app/grandchallenge/algorithms/admin.py | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/app/grandchallenge/algorithms/admin.py b/app/grandchallenge/algorithms/admin.py index 2ed5eb570..2067edd2a 100644 --- a/app/grandchallenge/algorithms/admin.py +++ b/app/grandchallenge/algorithms/admin.py @@ -5,7 +5,6 @@ from django.core.exceptions import ObjectDoesNotExist from django.db.models import Count, Sum from django.forms import ModelForm -from django.urls import reverse from django.utils.html import format_html from guardian.admin import GuardedModelAdmin @@ -54,7 +53,7 @@ class Meta: class AlgorithmAdmin(GuardedModelAdmin): readonly_fields = ( "algorithm_forge_json", - "default_interface_link", + "default_interface", "inputs", "outputs", ) @@ -62,7 +61,7 @@ class AlgorithmAdmin(GuardedModelAdmin): "title", "created", "public", - "default_interface_link", + "default_interface", "time_limit", "job_requires_gpu_type", "job_requires_memory_gb", @@ -77,19 +76,6 @@ class AlgorithmAdmin(GuardedModelAdmin): def container_count(self, obj): return obj.container_count - def default_interface_link(self, obj): - if obj.default_interface: - return format_html( - '{default_interface}', - link=reverse( - "admin:algorithms_algorithminterface_change", - kwargs={"object_id": obj.default_interface.pk}, - ), - default_interface=obj.default_interface, - ) - else: - return None - @staticmethod def algorithm_forge_json(obj): json_desc = get_forge_algorithm_template_context(algorithm=obj)