[Mpuls-commits] r779 - in wasko/branches/2.0: . waskaweb/lib
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Tue Jan 19 21:29:03 CET 2010
Author: bh
Date: 2010-01-19 21:28:59 +0100 (Tue, 19 Jan 2010)
New Revision: 779
Modified:
wasko/branches/2.0/ChangeLog.txt
wasko/branches/2.0/waskaweb/lib/helpers.py
Log:
* waskaweb/lib/helpers.py (get_logouttime): Do not use a
hard-wired value of the time-out duration. Add a doc-string.
Modified: wasko/branches/2.0/ChangeLog.txt
===================================================================
--- wasko/branches/2.0/ChangeLog.txt 2010-01-19 20:24:58 UTC (rev 778)
+++ wasko/branches/2.0/ChangeLog.txt 2010-01-19 20:28:59 UTC (rev 779)
@@ -1,5 +1,10 @@
2010-01-19 Bernhard Herzog <bh at intevation.de>
+ * waskaweb/lib/helpers.py (get_logouttime): Do not use a
+ hard-wired value of the time-out duration. Add a doc-string.
+
+2010-01-19 Bernhard Herzog <bh at intevation.de>
+
* waskaweb/lib/helpers.py (hasRole): Use a dictionary to map old
role-names to the names.
Modified: wasko/branches/2.0/waskaweb/lib/helpers.py
===================================================================
--- wasko/branches/2.0/waskaweb/lib/helpers.py 2010-01-19 20:24:58 UTC (rev 778)
+++ wasko/branches/2.0/waskaweb/lib/helpers.py 2010-01-19 20:28:59 UTC (rev 779)
@@ -216,7 +216,13 @@
return "%s: %s" % (dd_mm_yyyy_HH_MM(datetime.datetime.now()), s)
def get_logouttime():
- return HH_MM(datetime.datetime.now() + datetime.timedelta(minutes=28))
+ """Estimate log-out time and return it as a formatted string (HH:MM).
+ The estimated logout time is two minutes before the time the session
+ actually expires to make sure it's earlier.
+ """
+ timeout = int(config.get("beaker.session.timeout"))
+ return HH_MM(datetime.datetime.now()
+ + datetime.timedelta(seconds=timeout - 120))
def timedelta_in_minutes(ti):
if ti is None:
More information about the Mpuls-commits
mailing list