wcs: refer to blocks by slug, not url_name (#55213)

This commit is contained in:
Frédéric Péters 2021-06-28 22:01:12 +02:00
parent e134d93b86
commit 371e1cfa1e
1 changed files with 1 additions and 1 deletions

View File

@ -126,7 +126,7 @@ class Cmd(Command):
# do not use import_from_xml to avoid autofixing url_name.
blockdef = BlockDef.import_from_xml_tree(tree, include_id=False)
try:
existing_blockdef = BlockDef.get_by_urlname(blockdef.url_name)
existing_blockdef = BlockDef.get_on_index(blockdef.slug, 'slug')
except KeyError:
blockdef.store(comment='Indus Initial Import')
else: