Bug #3381
crash workflow.store() dans un cron
Début:
26 juillet 2013
Echéance:
% réalisé:
100%
Temps estimé:
Patch proposed:
Planning:
Description
Sur un wcs qui vient de changer de version, on peut avoir des migrate d'objets divers, par exemple de workflows, et se retrouver avec un "cron" qui va appeler ses migrate... sans get_request().
Exemple de trace reçue :
Exception: type = '<type 'exceptions.AttributeError'>', value = ''NoneType' object has no attribute 'user'' Stack trace (most recent call first): File "/usr/lib/pymodules/python2.7/wcs/workflows.py", line 107, in store 105 def store(self): 106 self.last_modification_time = time.localtime() > 107 if get_request().user: 108 self.last_modification_user_id = get_request().user.id 109 else: locals: self = <Workflow 'WF Nouveaux Majolans' id:15> File "/usr/lib/pymodules/python2.7/wcs/workflows.py", line 103, in migrate 101 102 if changed: > 103 self.store() 104 105 def store(self): locals: self = <Workflow 'WF Nouveaux Majolans' id:15> changed = True File "/usr/lib/pymodules/python2.7/wcs/qommon/storage.py", line 236, in get_filename 234 o.__class__ = cls 235 if not ignore_migration and hasattr(cls, 'migrate'): > 236 o.migrate() 237 return o 238 get_filename = classmethod(get_filename) locals: ignore_migration = False unpickler = <class publisher.UnpicklerClass at 0x3898f58> o = <Workflow 'WF Nouveaux Majolans' id:15> filename = '/var/lib/wcs-au-quotidien/meyzieu.au-quotidien.com/workflows/15' ignore_errors = True cls = <class 'wcs.workflows.Workflow'>
Révisions associées
Historique
Mis à jour par Thomas Noël il y a presque 11 ans
- Statut changé de Nouveau à Résolu (à déployer)
- % réalisé changé de 0 à 100
Appliqué par commit fbf7f3c47db28d6bd7971b578b98d0cdf9a63472.
fix workflow.store() in cron context (fix #3381)