Project

General

Profile

0003-workflows-rename-variable-and-move-a-line-to-ease-ne.patch

Nicolas Roche, 19 Sep 2019 05:14 PM

Download (2.5 KB)

View differences:

Subject: [PATCH 3/5] workflows: rename variable and move a line to ease new
 patch review (#35903)

 wcs/forms/common.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
wcs/forms/common.py
261 261
                context=context)
262 262

  
263 263
    def get_workflow_form(self, user):
264
        submitted_fields = []
265
        form = self.filled.get_workflow_form(user, displayed_fields=submitted_fields)
264
        displayed_fields = []
265
        form = self.filled.get_workflow_form(user, displayed_fields=displayed_fields)
266 266
        self.filled.evaluate_live_workflow_form(user, form)
267 267
        get_publisher().substitutions.unfeed(lambda x: x is self.filled)
268 268
        get_publisher().substitutions.feed(self.filled)
269 269
        # reevaluate workflow form according to possible new content
270
        submitted_fields = []
271
        form = self.filled.get_workflow_form(user, displayed_fields=submitted_fields)
270
        displayed_fields = []
271
        form = self.filled.get_workflow_form(user, displayed_fields=displayed_fields)
272 272
        if form:
273 273
            form.attrs['data-live-url'] = self.filled.get_url() + 'live'
274 274
        if form and form.is_submitted():
......
276 276
                # remove fields that could be required but are not visible
277 277
                self.filled.evaluate_live_workflow_form(user, form)
278 278
                get_publisher().substitutions.feed(self.filled)
279
                for field in submitted_fields:
279
                for field in displayed_fields:
280 280
                    if not field.is_visible(self.filled.data, self.formdef) and 'f%s' % field.id in form._names:
281 281
                        del form._names['f%s' % field.id]
282 282
        return form
......
680 680
        if not session:
681 681
            return result_error('missing session')
682 682

  
683
        displayed_fields = []
684 683
        user = get_request().user
684
        displayed_fields = []
685 685
        form = self.filled.get_workflow_form(user, displayed_fields=displayed_fields)
686 686
        self.filled.evaluate_live_workflow_form(user, form)
687 687
        get_publisher().substitutions.unfeed(lambda x: x is self.filled)
688
-