#7084: Catch ValueErrors when initializing dynamic form fields
This commit is contained in:
parent
528df76747
commit
707e51d855
|
|
@ -435,7 +435,7 @@ class DynamicModelChoiceMixin:
|
|||
filter = self.filter(field_name=field_name)
|
||||
try:
|
||||
self.queryset = filter.filter(self.queryset, data)
|
||||
except TypeError:
|
||||
except (TypeError, ValueError):
|
||||
# Catch any error caused by invalid initial data passed from the user
|
||||
self.queryset = self.queryset.none()
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in New Issue