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

resource_class was deprecated and removed, but it still works #1823

Closed
matthewhegarty opened this issue May 12, 2024 · 2 comments · Fixed by #1837
Closed

resource_class was deprecated and removed, but it still works #1823

matthewhegarty opened this issue May 12, 2024 · 2 comments · Fixed by #1837
Assignees
Labels

Comments

@matthewhegarty
Copy link
Contributor

Describe the bug

resource_class was removed in v4 in favour of resource_classes. However the following declaration still works:

class BookAdmin(ImportExportModelAdmin):
    list_display = ("name", "author", "added")
    list_filter = ["categories", "author"]
    resource_class = BookResource
    change_list_template = "core/admin/change_list.html"

We probably need to re-add the deprecation and ensure it is removed in a future release.

To Reproduce

update core/admin.py with the above snippet and you will find you can import a file ok.

@matthewhegarty matthewhegarty self-assigned this May 14, 2024
@AlmerCarbonEquity
Copy link

FYI: I think this caused a pretty nasty bug for me, because I think mistakenly using the deprecated resource_class prevents the class Meta: options from loading without giving a clear error message

@matthewhegarty
Copy link
Contributor Author

I have re-added the deprecation warnings. I'll leave the issue open as a reminder to remove the deprecations and ensure that resource_class cannot be set in a future release.

@matthewhegarty matthewhegarty added chore and removed bug labels May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants