# HG changeset patch # User Paul Boddie # Date 1461330223 -7200 # Node ID 46af5559d721c833e7b8544e0417a040d01fd355 # Parent 6f9d4c2c206c9857c2ad3b4dfbee47bbd77e302d Avoid making empty files or resources when encountering empty collections. diff -r 6f9d4c2c206c -r 46af5559d721 tools/copy_store.py --- a/tools/copy_store.py Fri Apr 22 15:03:16 2016 +0200 +++ b/tools/copy_store.py Fri Apr 22 15:03:43 2016 +0200 @@ -48,7 +48,9 @@ # Copy requests. - to_store.set_requests(user, from_store.get_requests(user)) + requests = from_store.get_requests(user) + if requests: + to_store.set_requests(user, requests) # Copy events, both active and cancellations. @@ -79,16 +81,22 @@ # Copy free/busy information for the user. - to_store.set_freebusy(user, from_store.get_freebusy(user)) + freebusy = from_store.get_freebusy(user) + if freebusy: + to_store.set_freebusy(user, freebusy) # Copy free/busy information for other users. for other in from_store.get_freebusy_others(user): - to_store.set_freebusy_for_other(user, from_store.get_freebusy_for_other(user, other), other) + freebusy = from_store.get_freebusy_for_other(user, other) + if freebusy: + to_store.set_freebusy_for_other(user, freebusy, other) # Copy free/busy offers. - to_store.set_freebusy_offers(user, from_store.get_freebusy_offers(user)) + offers = from_store.get_freebusy_offers(user) + if offers: + to_store.set_freebusy_offers(user, offers) # For each quota group...