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

Skip to content

ckan.lib.helpers.format_resource_items discards False boolean values #6350

@paulmueller

Description

@paulmueller

CKAN version
2.9

Describe the bug
I have boolean resource metadata keys defined via schemas in my DCOR instance. These are not written to the resources HTML page, because format_resource_items discards False boolean values.

Steps to reproduce
Set a value of a resource key to False.

Expected behavior
Value should be displayed on HTML resource page.

Additional details
This can be fixed by changing the line linked above

if not value or key in blacklist: 
    continue

to

if not isinstance(value, bool) and (not value or key in blacklist): 
    continue

I can write a PR including a test for format_resource_items if you give me green light.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions