We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7b16478 + 1f657da commit d23fab2Copy full SHA for d23fab2
flexselect/views.py
@@ -16,10 +16,10 @@ def field_changed(request):
16
hashed_name = request.POST.__getitem__('hashed_name')
17
widget = FlexSelectWidget.instances[hashed_name]
18
instance = instance_from_request(request, widget)
19
-
+ value_fk = getattr(instance, widget.base_field.name)
20
if bool(int(request.POST.__getitem__('include_options'))):
21
choices = choices_from_instance(instance, widget)
22
- options = Select(choices=choices).render_options([], [])
+ options = Select(choices=choices).render_options([], [value_fk.pk if value_fk else None])
23
else:
24
options = None
25
0 commit comments