Skip to content

Empty string prefix is added as "." #24

@me-kell

Description

@me-kell

when registering or using registry records from an interface with prefix='' plone.registry.registry.forInterface and plone.registry.registry.forInterface add a dot . as prefix (see below).

The conditional not prefix.endswith(".") should be extended with and prefix != ""

i.e. if not prefix.endswith(".") and prefix != "":

    def forInterface(self, interface, check=True, omit=(), prefix=None,
                     factory=None):
        if prefix is None:
            prefix = interface.__identifier__

        if not prefix.endswith("."):    # <- if not prefix.endswith(".") and prefix != "":
            prefix += '.'

    ...

    def registerInterface(self, interface, omit=(), prefix=None):
        if prefix is None:
            prefix = interface.__identifier__

        if not prefix.endswith("."):    # <- if not prefix.endswith(".") and prefix != "":
            prefix += '.'
    ...

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