Skip to content

Commit

Permalink
Fix Service environment inline (#3868)
Browse files Browse the repository at this point in the history
  • Loading branch information
matyldv authored Nov 21, 2024
1 parent 56d692d commit 016e4d7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/ralph/assets/admin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
from django.db.models import Count
from django.forms import BaseInlineFormSet
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _

Expand Down Expand Up @@ -129,11 +130,17 @@ class ServiceEnvironmentAdmin(CustomFieldValueAdminMixin, RalphAdmin):
fields = ('service', 'environment', 'remarks', 'tags')


class PolymorphicInlineFormset(BaseInlineFormSet):
def get_queryset(self):
return super().get_queryset()[:]


class ServiceEnvironmentInline(RalphTabularInline):
model = ServiceEnvironment
raw_id_fields = ['environment']
fields = ('environment',)
min_num = 1
formset = PolymorphicInlineFormset


class BaseObjectsList(ScanStatusInTableMixin, Table):
Expand Down

0 comments on commit 016e4d7

Please sign in to comment.