Commit 19235ec6 by Kálmán Viktor

dashboard: enable raw data in templates only for superusers

parent 7df6dd21
...@@ -512,6 +512,9 @@ class TemplateForm(forms.ModelForm): ...@@ -512,6 +512,9 @@ class TemplateForm(forms.ModelForm):
@property @property
def helper(self): def helper(self):
kwargs_raw_data = {}
if not self.user.is_superuser:
kwargs_raw_data['readonly'] = None
helper = FormHelper() helper = FormHelper()
helper.layout = Layout( helper.layout = Layout(
Field("name"), Field("name"),
...@@ -563,7 +566,7 @@ class TemplateForm(forms.ModelForm): ...@@ -563,7 +566,7 @@ class TemplateForm(forms.ModelForm):
"stuff", "stuff",
Field('access_method'), Field('access_method'),
Field('boot_menu'), Field('boot_menu'),
Field('raw_data'), Field('raw_data', **kwargs_raw_data),
Field('req_traits'), Field('req_traits'),
Field('description'), Field('description'),
Field("parent", type="hidden"), Field("parent", type="hidden"),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment