summaryrefslogtreecommitdiffstats
path: root/wallace
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-10-24 10:56:30 -0400
committerThomas Bruederli <bruederli@kolabsys.com>2014-10-24 10:56:30 -0400
commit9fc5eee035ec418937556f36971ceb7c5f1cd375 (patch)
treeef0a56100e59b01db138d4dfa78a60cd419139e7 /wallace
parent1ad076886f2ca1f61438005c1547a7229c0ef287 (diff)
downloadpykolab-9fc5eee035ec418937556f36971ceb7c5f1cd375.tar.gz
Make resource calendar expiry days configurable (#3843)
Diffstat (limited to 'wallace')
-rw-r--r--wallace/module_resources.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/wallace/module_resources.py b/wallace/module_resources.py
index 9376749..89b5544 100644
--- a/wallace/module_resources.py
+++ b/wallace/module_resources.py
@@ -442,14 +442,15 @@ def expunge_resource_calendar(mailbox):
"""
global imap
+ days = int(conf.get('wallace', 'resource_calendar_expire_days', 100))
+ now = datetime.datetime.now(tzlocal())
+ expire_date = now - datetime.timedelta(days=days)
+
log.debug(
- _("Expunge events in resource folder %r") % (mailbox),
+ _("Expunge events in resource folder %r older than %d days") % (mailbox, days),
level=8
)
- now = datetime.datetime.now(tzlocal())
- expire_date = now - datetime.timedelta(days=100)
-
# might raise an exception, let that bubble
targetfolder = imap.folder_quote(mailbox)
imap.set_acl(targetfolder, conf.get(conf.get('kolab', 'imap_backend'), 'admin_login'), "lrswipkxtecda")