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

@@ -500,6 +500,10 @@ class CSVModelChoiceField(forms.ModelChoiceField):
"""
Provides additional validation for model choices entered as CSV data.
"""
default_error_messages = {
'invalid_choice': 'Object not found.',
}
def to_python(self, value):
try:
return super().to_python(value)