[CalendarServer-changes] [9272] CalendarServer/branches/users/glyph/uuid-normalize/twistedcaldav/ mail.py
source_changes at macosforge.org
source_changes at macosforge.org
Thu May 24 13:33:29 PDT 2012
Revision: 9272
http://trac.macosforge.org/projects/calendarserver/changeset/9272
Author: glyph at apple.com
Date: 2012-05-24 13:33:28 -0700 (Thu, 24 May 2012)
Log Message:
-----------
As long as we're always fixing case on the whole mail tokens DB at startup _anyway_, fix case for urn:uuid: as well as mailto:.
Modified Paths:
--------------
CalendarServer/branches/users/glyph/uuid-normalize/twistedcaldav/mail.py
Modified: CalendarServer/branches/users/glyph/uuid-normalize/twistedcaldav/mail.py
===================================================================
--- CalendarServer/branches/users/glyph/uuid-normalize/twistedcaldav/mail.py 2012-05-24 20:33:25 UTC (rev 9271)
+++ CalendarServer/branches/users/glyph/uuid-normalize/twistedcaldav/mail.py 2012-05-24 20:33:28 UTC (rev 9272)
@@ -744,7 +744,12 @@
)
self._db_commit()
+
def lowercase(self):
+ """
+ Lowercase mailto: addresses (and uppercase urn:uuid: addresses!) so
+ they can be located via normalized names.
+ """
rows = self._db_execute(
"""
select ORGANIZER, ATTENDEE from TOKENS
@@ -759,6 +764,13 @@
update TOKENS set ORGANIZER = :1 WHERE ORGANIZER = :2
""", organizer.lower(), organizer
)
+ else:
+ from txdav.base.datastore.util import normalizeUUIDOrNot
+ self._db_execute(
+ """
+ update TOKENS set ORGANIZER = :1 WHERE ORGANIZER = :2
+ """, normalizeUUIDOrNot(organizer), organizer
+ )
self._db_execute(
"""
update TOKENS set ATTENDEE = :1 WHERE ATTENDEE = :2
@@ -766,6 +778,7 @@
)
self._db_commit()
+
def _db_version(self):
"""
@return: the schema version assigned to this index.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120524/f4259ab7/attachment-0001.html>
More information about the calendarserver-changes
mailing list