#28346: Misleading error message when validator cannot be serialized
-------------------------------------+-------------------------------------
     Reporter:  Peter Inglesby       |                    Owner:  nobody
         Type:                       |                   Status:  closed
  Cleanup/optimization               |
    Component:  Migrations           |                  Version:  1.11
     Severity:  Normal               |               Resolution:  invalid
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Peter Inglesby):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 Poking about at this some more, I think it is possible to serialize the
 validator in my example, because the `validate_max_words(300)` returns a
 function object that has a `__closure__` attribute which contains bindings
 to the environment in which the function object was created.

 I'm not sure though how reliable this would be for less simple examples,
 and given how easy it is to work around, I think the new error message is
 good enough.

--
Ticket URL: <https://code.djangoproject.com/ticket/28346#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.1de0a43649728746cccca34f787a7790%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to