Remove unsupported tags field added by NetBoxModelImportForm

This commit is contained in:
Jeremy Stretch 2023-07-28 09:10:42 -04:00
parent cef913c383
commit ced032bab1

View File

@ -90,19 +90,20 @@ class ContactAssignmentImportForm(NetBoxModelImportForm):
queryset=ContentType.objects.all(), queryset=ContentType.objects.all(),
help_text=_("One or more assigned object types") help_text=_("One or more assigned object types")
) )
contact = CSVModelChoiceField( contact = CSVModelChoiceField(
queryset=Contact.objects.all(), queryset=Contact.objects.all(),
to_field_name='name', to_field_name='name',
help_text=_('Assigned contact') help_text=_('Assigned contact')
) )
role = CSVModelChoiceField( role = CSVModelChoiceField(
queryset=ContactRole.objects.all(), queryset=ContactRole.objects.all(),
to_field_name='name', to_field_name='name',
help_text=_('Assigned role') help_text=_('Assigned role')
) )
# Remove the tags field added by NetBoxModelImportForm (unsupported by ContactAssignment)
tags = None
class Meta: class Meta:
model = ContactAssignment model = ContactAssignment
fields = ('content_type', 'object_id', 'contact', 'priority', 'role') fields = ('content_type', 'object_id', 'contact', 'priority', 'role')