Skip to content

Error in passing params from metadata parsers to storers #12883

@etj

Description

@etj

Expected Behavior

Elements parsed by a metadata parser should be propery passed to storers

Actual Behavior

Storers do not find the expected custom metadata dict.

Causes

The resourcebase_post_save function is called by merging the custom dict to the original kwargs:

https://github.com/GeoNode/geonode/blob/4.4.1/geonode/resource/manager.py#L426

        resourcebase_post_save(_resource.get_real_instance(), kwargs={**kwargs, **custom})

But then the custom key is searched within the kwargs, which is not we want:
https://github.com/GeoNode/geonode/blob/master/geonode/resource/utils.py#L466-L472

def resourcebase_post_save(instance, *args, **kwargs):
    """
    Used to fill any additional fields after the save.
    Has to be called by the children
    """
    if instance:
        instance = call_storers(instance.get_real_instance(), kwargs.get("custom", {}))

Specifications

  • GeoNode version: 4.4.x

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions