diff --git a/js/legacy/widgets/form/fields.js b/js/legacy/widgets/form/fields.js index 78319ad838..884d2f3cf2 100644 --- a/js/legacy/widgets/form/fields.js +++ b/js/legacy/widgets/form/fields.js @@ -1234,8 +1234,8 @@ _f.ButtonField.prototype.make_input = function() { var me = this; // make the input this.input = $btn(this.button_area, - me.df.label.substr(0,20) + ((me.df.label.length>20) ? '..' : ''), null, - {maxWidth:'170px', fontWeight:'bold'}, null, 1) + me.df.label, null, + {fontWeight:'bold'}, null, 1) this.input.onclick = function() { if(me.not_in_form) return; diff --git a/js/legacy/widgets/form/grid.js b/js/legacy/widgets/form/grid.js index 6505300c7c..11e9b0742e 100644 --- a/js/legacy/widgets/form/grid.js +++ b/js/legacy/widgets/form/grid.js @@ -106,7 +106,7 @@ _f.Grid.prototype.insert_column = function(doctype, fieldname, fieldtype, label, col.doctype = doctype; // for report (fields may be from diff doctypes) col.fieldname = fieldname; col.fieldtype = fieldtype; - col.innerHTML = '
'+label+'
'; + col.innerHTML = '
'+label+'
'; col.label = label; if(reqd) col.childNodes[0].style.color = "#D22"; diff --git a/py/webnotes/__init__.py b/py/webnotes/__init__.py index f12ac251e3..6e8af3d410 100644 --- a/py/webnotes/__init__.py +++ b/py/webnotes/__init__.py @@ -64,6 +64,12 @@ class UnknownDomainError(Exception): self.value = value def __str__(self): return repr(self.value) + +class SessionStopped(Exception): + def __init__(self, value): + self.value = value + def __str__(self): + return repr(self.value) def getTraceback(): import utils diff --git a/py/webnotes/auth.py b/py/webnotes/auth.py index 0488d15fa2..7633b733d7 100644 --- a/py/webnotes/auth.py +++ b/py/webnotes/auth.py @@ -60,7 +60,12 @@ class HTTPRequest: # check status if webnotes.conn.get_global("__session_status")=='stop': webnotes.msgprint(webnotes.conn.get_global("__session_status_message")) +<<<<<<< HEAD raise Exception +======= + raise webnotes.SessionStopped('Session Stopped') + #raise webnotes.ValidationError(webnotes.conn.get_global("__session_status_message")) +>>>>>>> fe327620e090d5a47a431a3ed8cc8e9aa0345672 # write out cookies if sid is supplied (this is a pre-logged in redirect) if webnotes.form_dict.get('sid'): diff --git a/py/webnotes/utils/scheduler.py b/py/webnotes/utils/scheduler.py index 50a18cec25..9a6e274de1 100644 --- a/py/webnotes/utils/scheduler.py +++ b/py/webnotes/utils/scheduler.py @@ -67,6 +67,9 @@ def execute(): if now.weekday()==0: out.append('weekly:' + trigger('execute_weekly')) + if now.hour != last.hour: + out.append('hourly:' + trigger('execute_hourly')) + out.append('all:' + trigger('execute_all')) webnotes.conn.set_global('scheduler_last_event', nowtime.strftime(format)) @@ -85,16 +88,18 @@ def trigger(method): return 'ok' except Exception, e: - webnotes.conn.rollback() - traceback = webnotes.getTraceback() - log(method, traceback) - return traceback - -def log(method, error): + return log(method) + +def log(method): """log error in patch_log""" + webnotes.conn.rollback() + traceback = webnotes.getTraceback() + import webnotes.utils webnotes.conn.sql("""insert into __SchedulerLog (`timestamp`, method, error) - values (%s, %s, %s)""", (webnotes.utils.now_datetime(), method, error)) - + values (%s, %s, %s)""", (webnotes.utils.now_datetime(), method, traceback)) + + return traceback + if __name__=='__main__': execute()