1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Remove boilerplate error messages from CSV model choice fields

This commit is contained in:
Jeremy Stretch
2020-05-06 09:58:12 -04:00
parent 70d0a5f665
commit 270d61ce1b
7 changed files with 85 additions and 324 deletions

View File

@@ -120,18 +120,12 @@ class SecretCSVForm(CustomFieldModelCSVForm):
device = CSVModelChoiceField(
queryset=Device.objects.all(),
to_field_name='name',
help_text='Assigned device',
error_messages={
'invalid_choice': 'Device not found.',
}
help_text='Assigned device'
)
role = CSVModelChoiceField(
queryset=SecretRole.objects.all(),
to_field_name='name',
help_text='Assigned role',
error_messages={
'invalid_choice': 'Invalid secret role.',
}
help_text='Assigned role'
)
plaintext = forms.CharField(
help_text='Plaintext secret data'