Skip to content
This repository was archived by the owner on Jun 21, 2024. It is now read-only.
This repository was archived by the owner on Jun 21, 2024. It is now read-only.

Datasources with List[str] attributes throw exception due to passing 'allow_blank' to serializers #59

@chrisdevereux

Description

@chrisdevereux

Resolved with override:

    def get_serializer_field_kwargs(self, field):
        type_info = get_type_info(field.type)

        if type_info.base_type == str and not type_info.is_many and not type_info.is_mapping:
            return {"allow_blank": True}

        if type_info.is_mapping or type_info.is_many:
            return {"allow_empty": True}

        return {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions