Projet

Général

Profil

0001-wscall-don-t-crash-on-invalid-targets-status-15712.patch

Thomas Noël, 31 mars 2017 15:32

Télécharger (1,6 ko)

Voir les différences:

Subject: [PATCH] wscall: don't crash on invalid targets status (#15712)

 wcs/wf/wscall.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
wcs/wf/wscall.py
360 360
            return
361 361
        if action == ':stop':
362 362
            raise AbortActionException()
363
        if not [x for x in self.parent.parent.possible_status if x.id == action]:
364
            # FIXME get_publisher().notify_of_exception ou un truc dans le genre
365
            raise AbortActionException()
363 366
        formdata.status = 'wf-%s' % action
364 367
        formdata.store()
365 368
        raise AbortActionException()
......
371 374
            value = getattr(self, attribute)
372 375
            if value in (':pass', ':stop'):
373 376
                continue
374
            targets.append(self.parent.parent.get_status(value))
377
            try:
378
                targets.extend([x for x in self.parent.parent.possible_status if x.id == value])
379
            except IndexError:
380
                get_publisher().get_app_logger().error(
381
                        'reference to invalid status in workflow %s, status %s, item %s' % (
382
                                self.parent.parent.name, self.parent.name, self.description))
375 383
        return targets
376 384

  
377 385
    def get_jump_label(self):
378
-