Hi Uri, Good spot. The docs have `The optional exclude argument lets you provide a list of field names to exclude from validation.` for `clean_fields()` so expecting a list seems reasonable. 🤔
This was changed in https://github.com/django/django/commit/1ea7e3157d1f9b4db71e768d75ea57e47dbd49f9 — it looks like your use-case isn't covered by the existing tests. Can I ask you to open a ticket on Trac, with a minimal test and we can have a look? Thanks! 👍 Kind Regards, Carlton On Thu, 19 May 2022 at 05:50, אורי <u...@speedy.net> wrote: > Hi, > > In my code there is clean_fields with exclude as an optional argument: > > def clean_fields(self, exclude=None): > """ > Allows to have different slug and username validators for Entity > and User. > """ > if (exclude is None): > exclude = [] > > Is it still optional and should I define it as a set if it's None? Or is > it not optional any more? > > I see in Django 4.1 alpha this is the code now: > def clean_fields(self, exclude=None): > """ > Clean all fields and raise a ValidationError containing a dict > of all validation errors if any occur. > """ > if exclude is None: > exclude = set() > > > > אורי > u...@speedy.net > > > On Wed, May 18, 2022 at 9:09 AM Carlton Gibson <carlton.gib...@gmail.com> > wrote: > >> Details are available on the Django project weblog: >> >> >> https://www.djangoproject.com/weblog/2022/may/18/django-41-alpha-1-released/ >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django developers (Contributions to Django itself)" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to django-developers+unsubscr...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-developers/CAJwKpyQmCB6q__p167GcmaH8dBT%3D-jSbtr2LLb_E63E9QRQUXQ%40mail.gmail.com >> <https://groups.google.com/d/msgid/django-developers/CAJwKpyQmCB6q__p167GcmaH8dBT%3D-jSbtr2LLb_E63E9QRQUXQ%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > -- > You received this message because you are subscribed to the Google Groups > "Django developers (Contributions to Django itself)" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-developers+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-developers/CABD5YeG9RYV2%2BqKN1_XT%2Bn0%3DJ6W2G0t-OWFBB-pLWQQFvEVJDQ%40mail.gmail.com > <https://groups.google.com/d/msgid/django-developers/CABD5YeG9RYV2%2BqKN1_XT%2Bn0%3DJ6W2G0t-OWFBB-pLWQQFvEVJDQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAJwKpyTTsPFQWBcnJJTgYzdGTk4Qxt5ef%3Dw%3DdRr%3DQD8Dhnjb%3Dg%40mail.gmail.com.