1.1 --- a/imip_store.py Tue Sep 29 23:26:49 2015 +0200
1.2 +++ b/imip_store.py Fri Oct 02 01:20:08 2015 +0200
1.3 @@ -856,6 +856,40 @@
1.4
1.5 return False
1.6
1.7 + def remove_cancellations(self, user, uid, recurrenceid=None):
1.8 +
1.9 + """
1.10 + Remove cancellations for 'user' for any event having the given 'uid'. If
1.11 + the optional 'recurrenceid' is specified, a specific instance or
1.12 + occurrence of an event is affected.
1.13 + """
1.14 +
1.15 + # Remove all recurrence cancellations if a general event is indicated.
1.16 +
1.17 + if not recurrenceid:
1.18 + for _recurrenceid in self.get_cancelled_recurrences(user, uid):
1.19 + self.remove_cancellation(user, uid, _recurrenceid)
1.20 +
1.21 + return self.remove_cancellation(user, uid, recurrenceid)
1.22 +
1.23 + def remove_cancellation(self, user, uid, recurrenceid=None):
1.24 +
1.25 + """
1.26 + Remove a cancellation for 'user' for the event having the given 'uid'.
1.27 + If the optional 'recurrenceid' is specified, a specific instance or
1.28 + occurrence of an event is affected.
1.29 + """
1.30 +
1.31 + # Remove any parent event cancellation or a specific recurrence
1.32 + # cancellation if indicated.
1.33 +
1.34 + filename = self.get_event_filename(user, uid, recurrenceid, "cancellations")
1.35 +
1.36 + if filename and exists(filename):
1.37 + return self._remove_object(filename)
1.38 +
1.39 + return False
1.40 +
1.41 class FilePublisher(FileBase):
1.42
1.43 "A publisher of objects."