Skip to content
Snippets Groups Projects
Commit 4945aa51 authored by LouisGendron's avatar LouisGendron
Browse files

Prevent read_only changes on DataSet update when read_only input isnt provided

parent d03fba8d
No related branches found
No related tags found
1 merge request!95Add custom CheckboxInput widget for read_only
...@@ -215,7 +215,7 @@ class DataSetMutation(DjangoModelFormMutation): ...@@ -215,7 +215,7 @@ class DataSetMutation(DjangoModelFormMutation):
@classmethod @classmethod
def get_form_kwargs(cls, root, info, **input) -> dict: def get_form_kwargs(cls, root, info, **input) -> dict:
kwargs = super().get_form_kwargs(root, info, **input) kwargs = super().get_form_kwargs(root, info, **input)
if 'read_only' not in kwargs['data']: if 'read_only' not in kwargs['data'] and 'instance' not in kwargs.keys():
kwargs['data']['read_only'] = True kwargs['data']['read_only'] = True
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