Thanks to visit codestin.com
Credit goes to github.com

Skip to content

api.content.create lacks schema validation #415

@jaroel

Description

@jaroel

As seen in https://community.plone.org/t/creating-custom-dexterity-objects-from-plone-api/7318/ we can currently set an invalid value/type for fields.
In this case the user is setting a str instead of a RichTextValue, which leads to tracebacks like

AttributeError: 'str' object has no attribute 'output_relative_to'

 - Expression: "python:context.text.output_relative_to(view.context)"
 - Filename:   ... egg/plone/app/contenttypes/browser/templates/document.pt
 - Location:   (line 15: col 29)
 - Source:     ... ucture python:context.text.output_relative_to(view.context)"
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Is this something we need to handle here, or is this something DX should do?

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