Commit 476d212c authored by Arnaud Fontaine's avatar Arnaud Fontaine

PortalTransforms: _unmapTransform(): Do not fail if there is nothing to actually unmap.

Calling manage_reloadAllTransforms was raising KeyError.
parent 0d516372
...@@ -319,11 +319,17 @@ class TransformTool(UniqueObject, ActionProviderBase, Folder): ...@@ -319,11 +319,17 @@ class TransformTool(UniqueObject, ActionProviderBase, Folder):
for i in transform.inputs: for i in transform.inputs:
for mti in registry.lookup(i): for mti in registry.lookup(i):
for mt in mti.mimetypes: for mt in mti.mimetypes:
mt_in = self._mtmap.get(mt, {}) try:
mt_in = self._mtmap[mt]
except KeyError:
continue
output = transform.output output = transform.output
mto = registry.lookup(output) mto = registry.lookup(output)
for mt2 in mto[0].mimetypes: for mt2 in mto[0].mimetypes:
l = mt_in[mt2] try:
l = mt_in[mt2]
except KeyError:
continue
for i in range(len(l)): for i in range(len(l)):
if transform.name() == l[i].name(): if transform.name() == l[i].name():
l.pop(i) l.pop(i)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment