bihealth / sodar-core

SODAR Core: A Django-based framework for building scientific data management web apps
MIT License
9 stars 1 forks source link

Timeline _get_ref_description() assumes mandatory "blank" key in link dict #1462

Closed mikkonie closed 1 month ago

mikkonie commented 1 month ago

When deprecating the old method of returning a timeline object link as dict instead of an object, we have made a mistake. blank has previously been optional, but here we access it directly with link['blank']. This will of course cause a crash if the key is not present.

            if link:
                # TODO: Remove in v1.1 (see #1398)
                if isinstance(link, dict):
                    logger.warning(DEPRECATE_LINK_DICT_MSG)
                    link = PluginObjectLink(
                        url=link['url'],
                        name=link['label'],
                        blank=link['blank'],
                    )

See also #1398.

mikkonie commented 1 month ago

Fixed.