Author: leidel
Date: Fri Sep 19 02:29:29 2008
New Revision: 75
Modified:
trunk/messages/fields.py
trunk/messages/views.py
Log:
Fixed a bug that prevented sending messages to users with case sensitive
usernames.
Modified: trunk/messages/fields.py
==============================================================================
--- trunk/messages/fields.py (original)
+++ trunk/messages/fields.py Fri Sep 19 02:29:29 2008
@@ -31,10 +31,10 @@
if isinstance(value, (list, tuple)):
return value
- names = set(value.lower().split(','))
- names_set = set([name.strip().lower() for name in names])
+ names = set(value.split(','))
+ names_set = set([name.strip() for name in names])
users = list(User.objects.filter(username__in=names_set))
- unknown_names = names_set ^ set([user.username.lower() for user in
users])
+ unknown_names = names_set ^ set([user.username for user in users])
if unknown_names:
raise forms.ValidationError(_(u"The following usernames are
incorrect: %(users)s") % {'users': ', '.join(unknown_names)})
Modified: trunk/messages/views.py
==============================================================================
--- trunk/messages/views.py (original)
+++ trunk/messages/views.py Fri Sep 19 02:29:29 2008
@@ -84,7 +84,7 @@
else:
form = form_class()
if recipient is not None:
- recipients = [u for u in
User.objects.filter(username__in=[r.strip().lower() for r in
recipient.split('+')])]
+ recipients = [u for u in
User.objects.filter(username__in=[r.strip() for r in recipient.split('+')])]
form.fields['recipient'].initial = recipients
return render_to_response(template_name, {
'form': form,
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pinax-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/pinax-updates?hl=en
-~----------~----~----~----~------~----~------~--~---