# HG changeset patch # User Paul Boddie # Date 1443562009 -7200 # Node ID 1f8d646247f488c3d2f27bbf59691d95b284fd1e # Parent 481df9da00f0e1f030e9c6884d68c8b3de22d922 Fixed attendee removal and controls for removal. diff -r 481df9da00f0 -r 1f8d646247f4 imipweb/event.py --- a/imipweb/event.py Tue Sep 29 21:03:03 2015 +0200 +++ b/imipweb/event.py Tue Sep 29 23:26:49 2015 +0200 @@ -93,7 +93,7 @@ "Return whether 'attendee' is new to the current object." - return attendee not in self.get_stored_attendees() + return attendee not in uri_values(self.get_stored_attendees()) # Access to stored object information. @@ -945,17 +945,20 @@ if args.has_key("remove"): still_to_remove = [] + correction = 0 for i in args["remove"]: try: - attendee = attendees[int(i)] - except IndexError: + i = int(i) - correction + attendee = attendees[i] + except (IndexError, ValueError): continue - if self.can_remove_attendee(attendee): - attendees.remove(attendee) + if self.can_remove_attendee(get_uri(attendee)): + del attendees[i] + correction += 1 else: - still_to_remove.append(i) + still_to_remove.append(str(i)) args["remove"] = still_to_remove @@ -977,17 +980,20 @@ if args.has_key("recur-remove"): still_to_remove = [] + correction = 0 for i in args["recur-remove"]: try: - recurrence = recurrences[int(i)] - except IndexError: + i = int(i) - correction + recurrence = recurrences[i] + except (IndexError, ValueError): continue if self.can_remove_recurrence(recurrence): - recurrences.remove(recurrence) + del recurrences[i] + correction += 1 else: - still_to_remove.append(i) + still_to_remove.append(str(i)) args["recur-remove"] = still_to_remove