added status validation

This commit is contained in:
Anand Doshi
2012-12-28 19:42:49 +05:30
parent b72d8204e8
commit f9a3c8fcdc
19 changed files with 410 additions and 355 deletions

View File

@@ -16,7 +16,8 @@
from __future__ import unicode_literals
import webnotes
from webnotes.utils import cint
from webnotes import _, msgprint
from webnotes.utils import cint, comma_or
@webnotes.whitelist()
def get_sc_list(arg=None):
@@ -52,4 +53,8 @@ def get_report_list():
and ifnull(tabReport.disabled,0) != 1
order by tabReport.name
limit %s, %s""" % \
("%s", cint(limit_start), cint(limit_page_length)), (module,), as_dict=True)
("%s", cint(limit_start), cint(limit_page_length)), (module,), as_dict=True)
def validate_status(status, options):
if status not in options:
msgprint(_("Status must be one of ") + comma_or(options), raise_exception=True)