KristianOellegaard/django-hvad — pull request #199 by jqb (2014-09-09 22:01:00+00:00)
Title: admin: fix for TranslatableAdmin "prepopulated_fields"

The problem is following:

django admin allows to use "prepopulated_fields_js" tag / feature only
if template context "add" variable is set to True. This is kind of
resonable - not to prepopulate eg. slug field that's already
saved). BUT. When you're editing translations for the given object only
first language has "add" context variable set to True in context. When
you switch tab to different language "add" is False (for already saved
object but different language).

Solution? - hvad.admin.TranslatableAdmin overrides original
"ModelAdmin.render_change_form" and adds some variables to context.
This includes "current_is_translated" which I use to override "add"
under the condition when translation for given language doesn't exists
yet.