Skip to content

Manager.get_related_objects should handle an incorrect ref_cls gracefully #111

@technige

Description

@technige

When the ref_cls argument passed to the Manager.get_related_objects function is neither Outgoing nor Incoming, the calling application fails with a LocalUnboundError which states that rel_query has not been defined.

Looking at the code at...

https://github.com/onefinestay/kaiso/blob/master/kaiso/persistence.py#L854

...it seems that inserting a simple else clause that raises a ValueError after line 859 could present a more meaningful error message in this case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions