expected behavior:
When I query a record that is not yet loaded in the registry by running an upgrade step which reads in registry records defined by xml or a zope.schema interface, I should receive a default parameter if I passed that into the get_registry_record function call
What happens:
|
if interface is not None: |
|
records = registry.forInterface(interface) |
|
_marker = object() |
|
if getattr(records, name, _marker) != _marker: |
|
return registry['{0}.{1}'.format(interface.__identifier__, name)] |
|
|
|
if default is not MISSING: |
|
return default |
The function already errors on L300 when the forInterface() call cannot find my schema, L305 is never reached in this case.
Module plone.api.portal, line 2, in get_registry_record
Module plone.api.validation, line 77, in wrapped
Module plone.api.portal, line 300, in get_registry_record
Module plone.registry.registry, line 78, in forInterface
KeyError: 'Interface `myproject.content.interfaces.IProjectSettings` defines a field `somefield`, for which there is no record.'
expected behavior:
When I query a record that is not yet loaded in the registry by running an upgrade step which reads in registry records defined by xml or a zope.schema interface, I should receive a default parameter if I passed that into the get_registry_record function call
What happens:
plone.api/src/plone/api/portal.py
Lines 299 to 306 in a8361ed
The function already errors on L300 when the forInterface() call cannot find my schema, L305 is never reached in this case.