Is this code necessary? If we're ending up with multiple entries in the property, that should be fixed in the caller, not here. If this makes a performance difference, I guess OK, but it should be an exact match using ==, not a .find() call. -wsv On Feb 14, 2007, at 8:32 AM, source_changes@macosforge.org wrote:
Revision 1187 Author cdaboo@apple.com Date 2007-02-14 08:32:03 -0800 (Wed, 14 Feb 2007) Log Message
Ignore %(principaluri)s in calendar user address template as server automatically adds those. Modified Paths
CalendarServer/trunk/twistedcaldav/directory/appleopendirectory.py Diff
Modified: CalendarServer/trunk/twistedcaldav/directory/ appleopendirectory.py (1186 => 1187)
--- CalendarServer/trunk/twistedcaldav/directory/ appleopendirectory.py 2007-02-14 16:16:11 UTC (rev 1186) +++ CalendarServer/trunk/twistedcaldav/directory/ appleopendirectory.py 2007-02-14 16:32:03 UTC (rev 1187) @@ -304,6 +304,12 @@ # Now do substitutions result = set() for template in self.cuaddrtemplates: + + # Ignore %(principaluri)s templates as we already default to adding those + if template.find("%(principaluri)s") != -1: + continue + + # Loop over each host variant for scheme, hostname, port in self.hostvariants: for subs in subslist: # Add in host substitution values _______________________________________________ calendarserver-changes mailing list calendarserver-changes@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo/calendarserver-changes