Re: Django 4.1 alpha 1 released

2022-05-19 Thread אורי
Hi Carlton, Thanks for your reply. I created a ticket: https://code.djangoproject.com/ticket/33724 I'm not sure how to create a test. Maybe you should just contain the following code (in a model): def clean_fields(self, exclude=None): if (exclude is None): exclude = []

Re: Django 4.1 alpha 1 released

2022-05-19 Thread Carlton Gibson
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 — i

Re: Django 4.1 alpha 1 released

2022-05-18 Thread אורי
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 optio

Re: Django 4.1 alpha 1 released

2022-05-18 Thread אורי
Hi, Django 4.0 had this code: errors = {} if exclude is None: exclude = [] else: exclude = list(exclude) try: self.clean_fields(exclude=exclude) except ValidationError as e: errors = e.update_error_dict(error