@@ -131,7 +131,12 @@ def handle(): | |||||
try: | try: | ||||
execute_cmd(cmd) | execute_cmd(cmd) | ||||
except webnotes.ValidationError, e: | except webnotes.ValidationError, e: | ||||
webnotes.errprint(e) | |||||
webnotes.errprint(webnotes.utils.getTraceback()) | |||||
if webnotes.request_method == "POST": | |||||
webnotes.conn.rollback() | |||||
except webnotes.PermissionError, e: | |||||
webnotes.errprint(webnotes.utils.getTraceback()) | |||||
webnotes.response['403'] = 1 | |||||
if webnotes.request_method == "POST": | if webnotes.request_method == "POST": | ||||
webnotes.conn.rollback() | webnotes.conn.rollback() | ||||
except: | except: | ||||
@@ -15,11 +15,10 @@ def get_data(module, doctypes='[]'): | |||||
def get_count(doctypes): | def get_count(doctypes): | ||||
count = {} | count = {} | ||||
can_read = webnotes.user.get_can_read() | |||||
for d in doctypes: | for d in doctypes: | ||||
try: | |||||
if doctype in can_read: | |||||
count[d] = get_doctype_count_from_table(d) | count[d] = get_doctype_count_from_table(d) | ||||
except webnotes.PermissionError, e: | |||||
pass | |||||
return count | return count | ||||
def get_doctype_count_from_table(doctype): | def get_doctype_count_from_table(doctype): | ||||
@@ -129,7 +129,6 @@ def load_doctypes(): | |||||
if t.startswith('`'): | if t.startswith('`'): | ||||
doctype = t[4:-1] | doctype = t[4:-1] | ||||
if not webnotes.has_permission(doctype): | if not webnotes.has_permission(doctype): | ||||
webnotes.response['403'] = 1 | |||||
raise webnotes.PermissionError, doctype | raise webnotes.PermissionError, doctype | ||||
doctypes[doctype] = webnotes.model.doctype.get(doctype) | doctypes[doctype] = webnotes.model.doctype.get(doctype) | ||||