Re: Error: Key 'groups' not found in 'UserForm'

2020-01-05 Thread Mike Dewhirst
Stephen Thank you. I should have remembered to return super()! That has stopped it barfing and I'll withdraw my earlier question. I'm still researching becauseĀ  kwargs["widget"] = CommonFilteredSelectMultiple doesn't seem to switch the field away from FilteredSelectMultiple. At this point an

Re: Error: Key 'groups' not found in 'UserForm'

2020-01-05 Thread Stephen J. Butler
Take another look at the doc's example on formfield_for_manytomany: https://docs.djangoproject.com/en/3.0/ref/contrib/admin/#django.contrib.admin.ModelAdmin.formfield_for_manytomany You need to call super() and this isn't the right way to override the widget. def formfield_for_manytomany(self, d

Re: Error: Key 'groups' not found in 'UserForm'

2020-01-05 Thread Mike Dewhirst
Significant refinement of the error ... Trying to use formfield_for_manytomany() triggers the error even if all it does is "pass" Something fishy ... I'll write a fresh question. Mike On 6/01/2020 12:46 pm, Mike Dewhirst wrote: This error occurs in the Admin for my custom user when I try to

Error: Key 'groups' not found in 'UserForm'

2020-01-05 Thread Mike Dewhirst
This error occurs in the Admin for my custom user when I try to specify a custom widget for permission groups. I haven't included 'groups' in any raw_id_fields, radio_fields or autocomplete_fields. The groups are correctly displayed in the Admin user page with the default FilteredSelectMultiple