Projet

Général

Profil

0001-sql-always-rebuild-security-attributes-of-formdata-i.patch

Frédéric Péters, 18 mai 2018 15:02

Télécharger (1,43 ko)

Voir les différences:

Subject: [PATCH] sql: always rebuild security attributes of formdata in the
 same order (#23918)

 wcs/sql.py       | 2 +-
 wcs/workflows.py | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
wcs/sql.py
1554 1554

  
1555 1555
    @classmethod
1556 1556
    def rebuild_security(cls):
1557
        formdatas = cls.select()
1557
        formdatas = cls.select(order_by='id')
1558 1558
        conn, cur = get_connection_and_cursor()
1559 1559
        for formdata in formdatas:
1560 1560
            sql_statement = '''UPDATE %s
wcs/workflows.py
347 347

  
348 348
        def update(job=None):
349 349
            # instruct all related formdefs to update.
350
            for form in FormDef.select(lambda x: x.workflow_id == self.id, ignore_migration=True):
350
            for form in FormDef.select(lambda x: x.workflow_id == self.id,
351
                    ignore_migration=True, order_by='id'):
351 352
                form.data_class().rebuild_security()
352 353
                if must_update:
353 354
                    form.rebuild()
354
-