Use dict indexing instead of .get to assert existence

Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
This commit is contained in:
Fabià Serra Arrizabalaga 2023-02-21 23:33:28 +01:00 committed by Jakub Trllo
parent f62e6c9c50
commit bfbfdf7067

View file

@ -694,7 +694,7 @@ def get_publish_repre_path(instance, repre, only_published=False):
# Expand the staging dir path in case it's been stored with the root
# template syntax
anatomy = instance.context.data.get("anatomy")
anatomy = instance.context.data["anatomy"]
staging_dir = anatomy.fill_root(staging_dir)
src_path = os.path.normpath(os.path.join(staging_dir, filename))