django-ecommerce-project icon indicating copy to clipboard operation
django-ecommerce-project copied to clipboard

ERRORS: <class 'store.admin.CategoryAdmin'>: (admin.E029) The value of 'prepopulated_fields["slug"]' must be a list or tuple.

Open AAdewunmi opened this issue 1 year ago • 0 comments

Hi,

Tried to create super user python manage.py createsuperuser and got the following error:

ERRORS:
<class 'store.admin.CategoryAdmin'>: (admin.E029) The value of 'prepopulated_fields["slug"]' must be a list or tuple.
<class 'store.admin.ProductAdmin'>: (admin.E029) The value of 'prepopulated_fields["slug"]' must be a list or tuple.

Here is a fix:

prepopulated_fields = {'slug': ('name,')}
prepopulated_fields = {'slug': ['name']}

prepopulated_fields = {'slug': ('title,')}
prepopulated_fields = {'slug': ['title']}

For an explanation on why you must use either a list or tuple, see Django Admin Documentation:

ModelAdmin.prepopulated_fields

😄

AAdewunmi avatar Nov 24 '23 09:11 AAdewunmi