diff --git a/credentials/apps/badges/admin.py b/credentials/apps/badges/admin.py index db26a5e48..ddb313598 100644 --- a/credentials/apps/badges/admin.py +++ b/credentials/apps/badges/admin.py @@ -5,8 +5,8 @@ from django.contrib import admin, messages from django.contrib.sites.shortcuts import get_current_site from django.core.management import call_command -from django.urls import resolve from django.utils.html import format_html +from django.utils.safestring import mark_safe from django.utils.translation import gettext_lazy as _ from django.urls import reverse @@ -35,12 +35,28 @@ class BadgeRequirementInline(admin.TabularInline): model = BadgeRequirement show_change_link = True extra = 0 + fields = ("event_type", "rules", "description") + readonly_fields = ("rules",) # FIXME: disable until "Release VI" exclude = [ "group", ] + def rules(self, obj): + """ + Display all data rules for the requirement. + """ + return format_html( + "