From 46fa6f147de4004b10a6a22716fb7b3dfd51172e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 7 Jan 2013 18:49:04 +0530 Subject: [PATCH 1/3] custom sample url for upload widget --- public/js/wn/upload.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/js/wn/upload.js b/public/js/wn/upload.js index 4536df7877..7c36493fec 100644 --- a/public/js/wn/upload.js +++ b/public/js/wn/upload.js @@ -9,7 +9,9 @@ wn.upload = { Upload a file:
\

\ OR:

\ -

e.g. http://example.com/somefile.png


\ +

' + + (opts.sample_url || 'e.g. http://example.com/somefile.png') + + '


\ \ ', { id: id, From c460bd5857de6479c86e2fca735df43ed815ac9d Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 8 Jan 2013 10:10:14 +0530 Subject: [PATCH 2/3] session expiry fix --- webnotes/sessions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webnotes/sessions.py b/webnotes/sessions.py index 2b122a78c4..03c7815676 100644 --- a/webnotes/sessions.py +++ b/webnotes/sessions.py @@ -193,7 +193,7 @@ class Session: def get_expiry_in_seconds(self, expiry): if not expiry: return 3600 parts = expiry.split(":") - return (int(parts[0]) * 3600) + (int(parts[1]) * 60) + int(parts[2]) + return (int(parts[0] or 0) * 3600) + (int(parts[1] or 0) * 60) + int(parts[2] or 0) def delete_session(self): webnotes.cache().delete_value("session:" + self.sid) From ca8d7444a90818b85d062e9516c63c5b6c11966b Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 8 Jan 2013 10:12:50 +0530 Subject: [PATCH 3/3] session expiry fix --- webnotes/sessions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webnotes/sessions.py b/webnotes/sessions.py index 03c7815676..e3ec3609ec 100644 --- a/webnotes/sessions.py +++ b/webnotes/sessions.py @@ -30,6 +30,7 @@ permission, homepage, control panel variables, system defaults etc import webnotes import conf import json +from webnotes.utils import cint @webnotes.whitelist() def clear(user=None): @@ -193,7 +194,7 @@ class Session: def get_expiry_in_seconds(self, expiry): if not expiry: return 3600 parts = expiry.split(":") - return (int(parts[0] or 0) * 3600) + (int(parts[1] or 0) * 60) + int(parts[2] or 0) + return (cint(parts[0]) * 3600) + (cint(parts[1]) * 60) + cint(parts[2]) def delete_session(self): webnotes.cache().delete_value("session:" + self.sid)