# HG changeset patch # User Paul Boddie # Date 1445885209 -3600 # Node ID fade5d6b17907f82e8d4fd0231484560d81ca8c6 # Parent d8b0495f4f1a55dc4c893e029a4eae780b4a24e4 Preserve the original object where a corrected version cannot be scheduled. diff -r d8b0495f4f1a -r fade5d6b1790 imiptools/handlers/scheduling.py --- a/imiptools/handlers/scheduling.py Mon Oct 26 19:37:27 2015 +0100 +++ b/imiptools/handlers/scheduling.py Mon Oct 26 19:46:49 2015 +0100 @@ -53,6 +53,8 @@ returning an indication of the kind of response to be returned. """ + obj = handler.obj.copy() + # Check any constraints on the request. try: @@ -66,6 +68,12 @@ # With a valid request, determine whether the event can be scheduled. scheduled = schedule_in_freebusy(handler) + + # Restore the original object if it was corrected but could not be + # scheduled. + + if scheduled == "DECLINED" and corrected: + handler.set_object(obj) # Where the corrected object can be scheduled, issue a counter # request.