Projet

Général

Profil

0001-backoffice-prevent-custom-views-and-ics-CardPage-vie.patch

Corentin Séchet, 09 mai 2022 17:16

Télécharger (1,3 ko)

Voir les différences:

Subject: [PATCH] backoffice: prevent custom views and ics & CardPage views
 slug conflict (#64981)

 wcs/custom_views.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
wcs/custom_views.py
20 20
from django.utils.encoding import force_text
21 21
from quixote import get_publisher
22 22

  
23
from wcs.backoffice.data_management import CardPage
23 24
from wcs.carddef import CardDef
24 25
from wcs.formdef import FormDef
25 26
from wcs.qommon.misc import simplify
......
117 118
        # prevent conflicts with system view names
118 119
        from wcs.backoffice.management import FormPage
119 120

  
120
        if base_slug in [x if isinstance(x, str) else x[0] for x in FormPage._q_exports]:
121
        reserved_slugs = [
122
            x if isinstance(x, str) else x[0] for x in FormPage._q_exports + CardPage._q_exports
123
        ] + ['ics']
124

  
125
        if base_slug in reserved_slugs:
121 126
            base_slug = 'x-' + base_slug
122 127

  
123 128
        self.slug = base_slug
124
-