misc: handle unpickling from classes that used absolute import (#36565)

This commit is contained in:
Frédéric Péters 2019-09-30 21:45:52 +02:00
parent 8b9c2f838e
commit d50ce84406
1 changed files with 2 additions and 0 deletions

View File

@ -54,6 +54,8 @@ class UnpicklerClass(pickle.Unpickler):
def find_class(self, module, name):
if module == 'qommon.form':
module = 'wcs.qommon.form'
elif module in ('formdata', 'formdef', 'users', 'workflows'):
module = 'wcs.%s' % module
__import__(module)
mod = sys.modules[module]
klass = getattr(mod, name)