This commit is contained in:
Rushabh Mehta 2013-01-08 10:43:19 +05:30
commit 91c47e24f9
2 changed files with 5 additions and 2 deletions

View file

@ -9,7 +9,9 @@ wn.upload = {
'+wn._('Upload a file')+':<br>\
<input type="file" name="filedata" /><br><br>\
OR:<br><input type="text" name="file_url" /><br>\
<p class="help">e.g. http://example.com/somefile.png</p><br>\
<p class="help">'
+ (opts.sample_url || 'e.g. http://example.com/somefile.png')
+ '</p><br>\
<input type="submit" class="btn" value="'+wn._('Attach')+'" />\
</form>', {
id: id,

View file

@ -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]) * 3600) + (int(parts[1]) * 60) + int(parts[2])
return (cint(parts[0]) * 3600) + (cint(parts[1]) * 60) + cint(parts[2])
def delete_session(self):
webnotes.cache().delete_value("session:" + self.sid)