﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
29929	ModelAdmin.prepopulated_fields crashing admin when showing read-only view	Sébastiaan Versteeg	Basil Dubyk	"The values of the `ModelAdmin.prepopulated_fields` field will be used when showing a read-only view in the admin. This results in a `KeyError`: `""Key 'to_be_prepopulated' not found in 'SampleModelForm'. Choices are: .""`.

{{{
#!python
class SampleModel(models.Model):
    input_value = models.TextField()
    to_be_prepopulated = models.TextField()
}}}
{{{
#!python
@admin.register(SampleModel)
class SampleModelAdmin(admin.ModelAdmin):
    prepopulated_fields = {'to_be_prepopulated': ('input_value',)}

    def has_change_permission(self, request, obj=None):
        return False
}}}"	Bug	closed	contrib.admin	2.1	Release blocker	fixed			Accepted	1	0	0	0	0	0
