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
fix: some Django antipatterns #7867
Conversation
why am I considered as a new contributor and why this notification then fails? |
@jrief I appreciate the initiative! IHMO in the admin files all The only question I have: Why does pageadmin need to import |
remove unused import
ups... some remaining from my private branch |
Adding my approval to this as I'm passing, pending that bit of cleanup. |
Description
This PR does not change any functionality!
It just fixes two anti-patterns in django-CMS:
force_str(_("…some text…"))
is completely useless because it forces to stringify a proxy object. A better and faster way is to usegettext("…some text…")
directly.HttpResponse(json.dumps(content), content_type="application/json")
probably is a legacy statement. Django introducedJsonResponse
many versions ago.Related resources
We discussed about this during one of our biweekly meetings.
Checklist
develop-4
I ran all unit tests successfully on my local environment.