Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in passing params from metadata parsers to storers #12883

Open
etj opened this issue Feb 6, 2025 · 1 comment · Fixed by #12884
Open

Error in passing params from metadata parsers to storers #12883

etj opened this issue Feb 6, 2025 · 1 comment · Fixed by #12884
Assignees
Milestone

Comments

@etj
Copy link
Contributor

etj commented Feb 6, 2025

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
@etj
Copy link
Contributor Author

etj commented Feb 11, 2025

Should also be fixed on master:

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

Also note that that part shall be probably reworked on #12902

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants