Skip to content

Commit

Permalink
Remove default interface link from admin
Browse files Browse the repository at this point in the history
  • Loading branch information
amickan committed Dec 12, 2024
1 parent 914452b commit 65b4a25
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions app/grandchallenge/algorithms/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -54,15 +53,15 @@ class Meta:
class AlgorithmAdmin(GuardedModelAdmin):
readonly_fields = (
"algorithm_forge_json",
"default_interface_link",
"default_interface",
"inputs",
"outputs",
)
list_display = (
"title",
"created",
"public",
"default_interface_link",
"default_interface",
"time_limit",
"job_requires_gpu_type",
"job_requires_memory_gb",
Expand All @@ -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(
'<a href="{link}">{default_interface}</a>',
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)
Expand Down

0 comments on commit 65b4a25

Please sign in to comment.