Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent nodes without registered entry points from being stored #3886

Merged
merged 2 commits into from
Apr 3, 2020

Commits on Apr 1, 2020

  1. Prevent nodes without registered entry points from being stored

    Up until now it was possible to store instances of `Node` subclasses
    that do not have a registered entry point. Imagine for example the
    definition of a `Data` subclass called `SubClass` in a shell and an
    instance being stored. The node type string will be:
    
      `__main__.SubClass.`
    
    When trying to load this node at a later point in time, the type string
    can of course not be resolved to an importable class and the loader
    would raise an exception.
    
    The first change is that this exception is now turned into a warning and
    the loader falls back onto the `Data` class. Note that we do not use the
    `Node` class for this as this base class is also not storable and so the
    ORM logic is potentially ill-defined for instances of the base `Node`.
    
    Secondly, we now add a check to `Node.store` to make sure that the class
    corresponds to a registered entry point. If this is not the case, the
    store method will raise `StoringNotAllowed`.
    
    One unit test was deleted because its implementation was incorrect and
    was not actually testing what it was intending to test. Besides intended
    functionality is now covered by other tests.
    sphuber committed Apr 1, 2020
    Configuration menu
    Copy the full SHA
    bc95ffb View commit details
    Browse the repository at this point in the history

Commits on Apr 3, 2020

  1. Configuration menu
    Copy the full SHA
    fd15288 View commit details
    Browse the repository at this point in the history