Skip to content
Snippets Groups Projects
Commit 6fff8b5f authored by Todd Dembrey's avatar Todd Dembrey
Browse files

Use a values_list to get the choices from the category

parent 2a762065
No related branches found
No related tags found
Loading
...@@ -32,8 +32,8 @@ class CategoryQuestionBlock(FormFieldBlock): ...@@ -32,8 +32,8 @@ class CategoryQuestionBlock(FormFieldBlock):
def get_field_kwargs(self, struct_value): def get_field_kwargs(self, struct_value):
kwargs = super().get_field_kwargs(struct_value) kwargs = super().get_field_kwargs(struct_value)
options = struct_value['category'].options.all() category = struct_value['category']
choices = ((option.id, option.value) for option in options) choices = category.options.values_list('id', 'value')
kwargs.update({'choices': choices}) kwargs.update({'choices': choices})
return kwargs return kwargs
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment