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

provide tests for wrong dict access of admin class not raising TypeError #749

Closed

Conversation

benzkji
Copy link

@benzkji benzkji commented Aug 7, 2024

this is the cause for #745 and #748. I don't have a solution (yet).

@benzkji
Copy link
Author

benzkji commented Aug 13, 2024

This PR shows how dict access of a admin class that inherits from a TranslationAdmin is possible, and doesn't throw any error.

The dict access (which should raise a TypeError) returns the class itself, which leads to the errors in django-cms (caused by how the template system accesses data, see https://github.com/django/django/blob/main/django/template/base.py#L886, where first, dict access is tried, and not getattr afterwards, if this is successful).

@last-partizan
Copy link
Collaborator

Thanks, closing this PR.

I will use your code as a base for a proper test and fix.

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 this pull request may close these issues.

2 participants