Upgrade attachments CLI cmd: added compatibility with new 'validator' key
We now support both the old coerce=markdown and the new validator=markdown. Probably support for the old can be removed, but I'm keeping it around just to be sure.
This commit is contained in:
@@ -767,7 +767,9 @@ def iter_markdown(proj_node_types: dict, some_node: dict, callback: typing.Calla
|
|||||||
continue
|
continue
|
||||||
to_visit.append((subdoc, definition['schema']))
|
to_visit.append((subdoc, definition['schema']))
|
||||||
continue
|
continue
|
||||||
if definition.get('coerce') != 'markdown':
|
coerce = definition.get('coerce') # Eve < 0.8
|
||||||
|
validator = definition.get('validator') # Eve >= 0.8
|
||||||
|
if coerce != 'markdown' and validator != 'markdown':
|
||||||
continue
|
continue
|
||||||
|
|
||||||
my_log.debug('I have to change %r of %s', key, doc)
|
my_log.debug('I have to change %r of %s', key, doc)
|
||||||
|
Reference in New Issue
Block a user