Projet

Général

Profil

0001-perfs-use-a-dictionary-to-exclude-drafts-from-tables.patch

Frédéric Péters, 25 août 2019 09:59

Télécharger (1,04 ko)

Voir les différences:

Subject: [PATCH] perfs: use a dictionary to exclude drafts from tables
 (#35570)

 wcs/forms/backoffice.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
wcs/forms/backoffice.py
121 121
        formdata_class = self.formdef.data_class()
122 122
        if selected_filter == 'all':
123 123
            item_ids = formdata_class.keys()
124
            drafts = formdata_class.get_ids_with_indexed_value('status', 'draft')
124
            drafts = {x: True for x in formdata_class.get_ids_with_indexed_value('status', 'draft')}
125 125
            item_ids = [x for x in item_ids if x not in drafts]
126 126
        elif selected_filter == 'waiting':
127 127
            user_roles = [logged_users_role().id] + (user.roles or [])
128
-