#3989: Django seems to parse only the addr-spec production of RFC 2822
-------------------------------------------------------------+--------------
Reporter: Pierre Thierry <[EMAIL PROTECTED]> | Owner:
adrian
Status: new |
Component: django.core.mail
Version: SVN |
Resolution:
Keywords: |
Stage: Accepted
Has_patch: 1 |
Needs_docs: 1
Needs_tests: 0 |
Needs_better_patch: 1
-------------------------------------------------------------+--------------
Changes (by mtredinnick):
* needs_better_patch: 0 => 1
* needs_docs: 0 => 1
Comment:
A couple of comments on the patch:
1. Whatever is needed to support newforms also needs to be included.
Until we have model-aware validation, we can't completely avoid patching
validators.py, so the current patch is partly in the right place.
2. Rather than defining a whole bunch of constants that are only used
once and then just hang around polluting the namespace, how about using
the re.VERBOSE flag and putting the reg-exp back together into a single
expression, like it is in the current code? No problems with spreading it
out a little bit, but the current patch makes it look like there is more
going on than there really is: it takes a bit of study to realise that
there are six things going into the one reg-exp and that's the only place
they're useful. You can probably keep ADDR_SPEC out as a separate string,
because it's used twice. Or maybe there's another way to format things,
but it takes more than a couple of seconds to understand what's going on
at the moment.
3. A documentation update in model-api.txt to give a couple of examples
of "valid email field" is now required, since people aren't going to
necessarily guess that display names are also allowed.
Patch seems simple enough. Tweak it a little bit and I won't stand in the
way.
--
Ticket URL: <http://code.djangoproject.com/ticket/3989#comment:7>
Django Code <http://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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---