Project

General

Profile

Bug #37512

crash sur attribution de rôle lors d'un get_computed_role_id qiu renvoie None

Added by Thomas Noël 10 days ago. Updated 10 days ago.

Status:
Nouveau
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
07 Nov 2019
Due date:
% Done:

0%

Patch proposed:
No
Planning:
No

Description

Il faut rendre get_computed_role_id résistante à une évaluation Python qui renvoie un truc bizarre (ici None, peut-être voire d'autres cas, ou pas)

type = '<type 'exceptions.AttributeError'>', value = ''NoneType' object has no attribute 'startswith''

Stack trace (most recent call first):
  File "/usr/lib/python2.7/posixpath.py", line 68, in join
    66     path = a
    67     for b in p:
>   68         if b.startswith('/'):
    69             path = b
    70         elif path == '' or path.endswith('/'):

  locals:
     a = '/var/lib/wcs/demarches.mesdemarches06.fr/roles'
     b = None
     p = (None,)
     path = '/var/lib/wcs/demarches.mesdemarches06.fr/roles'

  File "/usr/lib/python2.7/dist-packages/wcs/qommon/storage.py", line 297, in has_key
   295     @classmethod
   296     def has_key(cls, id):
>  297         filename = os.path.join(cls.get_objects_dir(), fix_key(id))
   298         return os.path.exists(filename)
   299

  locals:
     cls = <class 'wcs.roles.Role'>
     id = None

  File "/usr/lib/python2.7/dist-packages/wcs/workflows.py", line 1892, in get_computed_role_id
  1890     def get_computed_role_id(self, role_id):
  1891         new_role_id = self.compute(str(role_id))
> 1892         if Role.has_key(new_role_id):
  1893             return new_role_id
  1894         # computed value, not an id, try to get role by slug

  locals:
     new_role_id = None
     role_id = '=form_var_email'

History

#1 Updated by Thomas Noël 10 days ago

  • Status changed from Nouveau to Solution validée

#2 Updated by Frédéric Péters 10 days ago

  • Status changed from Solution validée to Nouveau

Also available in: Atom PDF