In admin, I have the class `EmployeeInline`:
{{{
class EmployeeInline(admin.StackedInline):
model = models.Employee
can_delete = False
verbose_name_plural = 'employee'
}}}
And use it in the `UserAdmin` class in the following way:
{{{
@admin.register(models.User)
class UserAdmin(DefaultUserAdmin):
def change_view(self, request, object_id, form_url='',
extra_context=None):
self.inlines = [EmployeeInline]
return super(UserAdmin, self).change_view(
request, object_id, form_url, extra_context
)
}}}
I see role field correct on the admin page, but if I try to save the model
without selected role, I have an error:
{{{
IntegrityError at /admin/auth/user/232/change/
null value in column "role" violates not-null constraint
DETAIL: Failing row contains (232, , 232, , , , 31, t, f, null, null).
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29355>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Tim Graham):
What version of Django are you using? Does the problem happen in non-
inline forms? I can't reproduce the issue there and I didn't try the
complete steps you offered.
--
Ticket URL: <https://code.djangoproject.com/ticket/29355#comment:1>
* status: new => closed
* resolution: => needsinfo
Comment:
I tried to reproduce this and couldn't do so. The details are somewhat
sparse, perhaps you might provide a sample project.
--
Ticket URL: <https://code.djangoproject.com/ticket/29355#comment:2>