Projet

Général

Profil

0002-misc-merge-allow_python-and-django_only-options.patch

Lauréline Guérin, 25 novembre 2021 16:36

Télécharger (2,94 ko)

Voir les différences:

Subject: [PATCH 2/2] misc: merge allow_python and django_only options

 wcs/fields.py             | 6 +++---
 wcs/qommon/form.py        | 2 +-
 wcs/wf/assign_carddata.py | 1 -
 wcs/workflows.py          | 2 +-
 4 files changed, 5 insertions(+), 6 deletions(-)
wcs/fields.py
763 763
            value=self.condition,
764 764
            required=False,
765 765
            size=50,
766
            django_only=True,
766
            allow_python=False,
767 767
            advanced=not (bool(self.condition)),
768 768
        )
769 769
        if 'anonymise' in self.get_admin_attributes():
......
885 885
            value=self.condition,
886 886
            required=False,
887 887
            size=50,
888
            django_only=True,
888
            allow_python=False,
889 889
            advanced=not (bool(self.condition)),
890 890
        )
891 891
        form.add(
......
986 986
            value=self.condition,
987 987
            required=False,
988 988
            size=50,
989
            django_only=True,
989
            allow_python=False,
990 990
            advanced=not (bool(self.condition)),
991 991
        )
992 992
        form.add(
wcs/qommon/form.py
2940 2940

  
2941 2941
        options = []
2942 2942
        options.append(('django', _('Django Expression'), 'django'))
2943
        if not kwargs.get('django_only') and not get_publisher().has_site_option(
2943
        if kwargs.get('allow_python', True) and not get_publisher().has_site_option(
2944 2944
            'disable-python-expressions'
2945 2945
        ):
2946 2946
            options.append(('python', _('Python Expression'), 'python'))
wcs/wf/assign_carddata.py
30 30
    manual_targetting = _('Specify the identifier of the card which will be assigned')
31 31
    always_show_user_fields = True
32 32
    allow_python = False
33
    django_only = True
34 33

  
35 34
    def get_parameters(self):
36 35
        return (
wcs/workflows.py
2176 2176
                value=self.condition,
2177 2177
                size=40,
2178 2178
                advanced=not (self.condition),
2179
                django_only=getattr(self, 'django_only', False),
2179
                allow_python=getattr(self, 'allow_python', True),
2180 2180
            )
2181 2181

  
2182 2182
        if 'attachments' in parameters:
2183
-