Skip to content

Edge Case: Missing admin_object_app_url results not handled in header_back_button template (only with django cms plugins) #1964

Description

@metaforx

Did you used AI to write this issue?

No

What version of Unfold are you using?

0.81.0

What version of Django are you using?

5.2

Did you checked changelog/commit history, if the bug is not already fixed?

Yes

Are you able to replicate the bug in the demo site?

Bug is related to django cms plugin handling, or other django app without the need of admin_object_app_url

Describe your issue

NoReverseMatch at /admin/cms/placeholder/delete-plugin/1594/

When using Unfold with Django CMS (which is not the primary intention, I know), we get errors in newer versions of Unfold when deleting plugins. The issue is in header_back_button.html

Likely this change could be the cause:

{% url object|admin_object_app_url:"changelist" as changelist_url %}
{% admin_object_app_url object "changelist" as changelist_url %}

If we would check if reverse is existing, we could catch this error.

{% admin_object_app_url object "changelist" as changelist_url %}
{% url changelist_url as resolved_changelist_url %}

This check should not harm unfold at all but would benefit other ways of integration, eg. use with django CMS

Metadata

Metadata

Assignees

No one assigned

    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