diff --git a/pykolab/itip/__init__.py b/pykolab/itip/__init__.py --- a/pykolab/itip/__init__.py +++ b/pykolab/itip/__init__.py @@ -190,13 +190,13 @@ # Scroll forward the kolab event recurrence until we're in the prime # spot. We choose to start with the Kolab event because that is likely - # the older one. + # the older o:wqne. if _ee < _is: while _ee < _is and _es is not None and kolab_event.is_recurring(): log.debug("Attempt to move forward kolab event recurrence from %s closer to %s" % (_ee, _is), level=8) __es = to_dt(kolab_event.get_next_occurence(_es)) - if not __es is None: + if __es is not None and not __es == _es: _es = __es _ee = to_dt(kolab_event.get_occurence_end_date(_es)) else: @@ -210,7 +210,7 @@ log.debug("Attempt to move forward itip event recurrence from %s closer to %s" % (_ie, _es), level=8) __is = to_dt(itip_event['xml'].get_next_occurence(_is)) - if not __is is None: + if __is is not None and not _is == __is: _is = __is _ie = to_dt(itip_event['xml'].get_occurence_end_date(_is)) else: @@ -219,7 +219,12 @@ # Now that we have some events somewhere in the same neighborhood... conflict = check_date_conflict(_es, _ee, _is, _ie) - log.debug("* Comparing itip at %s/%s with kolab at %s/%s: %r (%d)" % (_is, _ie, _es, _ee, conflict, loop), level=8) + log.debug( + "* Comparing itip at %s/%s with kolab at %s/%s: conflict - %r (occurence - %d)" % ( + _is, _ie, _es, _ee, conflict, loop + ), + level=8 + ) if not conflict: if kolab_event.is_recurring() and itip_event['xml'].is_recurring():