backoffice: do not include python test tools if python is forbidden (#76103)
This commit is contained in:
parent
bd9e89cd6a
commit
8613d9d7d2
|
@ -3462,7 +3462,9 @@ class FormBackOfficeStatusPage(FormStatusPage):
|
|||
('template', '%s / %s' % (_('Template'), _('Django Expression')), 'template'),
|
||||
('html_template', _('HTML Template (WYSIWYG)'), 'html_template'),
|
||||
]
|
||||
if get_publisher().has_site_option('disable-python-expressions'):
|
||||
if get_publisher().has_site_option('disable-python-expressions') or get_publisher().has_site_option(
|
||||
'forbid-python-expressions'
|
||||
):
|
||||
options = [x for x in options if x[0] != 'python-condition']
|
||||
form.add(
|
||||
RadiobuttonsWidget,
|
||||
|
@ -3481,7 +3483,10 @@ class FormBackOfficeStatusPage(FormStatusPage):
|
|||
'data-dynamic-display-value': 'django-condition',
|
||||
},
|
||||
)
|
||||
if not get_publisher().has_site_option('disable-python-expressions'):
|
||||
if not (
|
||||
get_publisher().has_site_option('disable-python-expressions')
|
||||
or get_publisher().has_site_option('forbid-python-expressions')
|
||||
):
|
||||
form.add(
|
||||
StringWidget,
|
||||
'python-condition',
|
||||
|
|
Loading…
Reference in New Issue