Kaynağa Gözat

[permission] [minor] moved 403 to handler.py

version-14
Rushabh Mehta 12 yıl önce
ebeveyn
işleme
af42359692
3 değiştirilmiş dosya ile 8 ekleme ve 5 silme
  1. +6
    -1
      webnotes/handler.py
  2. +2
    -3
      webnotes/widgets/moduleview.py
  3. +0
    -1
      webnotes/widgets/reportview.py

+ 6
- 1
webnotes/handler.py Dosyayı Görüntüle

@@ -131,7 +131,12 @@ def handle():
try:
execute_cmd(cmd)
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":
webnotes.conn.rollback()
except:


+ 2
- 3
webnotes/widgets/moduleview.py Dosyayı Görüntüle

@@ -15,11 +15,10 @@ def get_data(module, doctypes='[]'):
def get_count(doctypes):
count = {}
can_read = webnotes.user.get_can_read()
for d in doctypes:
try:
if doctype in can_read:
count[d] = get_doctype_count_from_table(d)
except webnotes.PermissionError, e:
pass
return count

def get_doctype_count_from_table(doctype):


+ 0
- 1
webnotes/widgets/reportview.py Dosyayı Görüntüle

@@ -129,7 +129,6 @@ def load_doctypes():
if t.startswith('`'):
doctype = t[4:-1]
if not webnotes.has_permission(doctype):
webnotes.response['403'] = 1
raise webnotes.PermissionError, doctype
doctypes[doctype] = webnotes.model.doctype.get(doctype)


Yükleniyor…
İptal
Kaydet