Просмотр исходного кода

Merge pull request #5 from nabinhait/master

fixed spelling mistake
version-14
Rushabh Mehta 14 лет назад
Родитель
Сommit
9dec837f2a
2 измененных файлов: 7 добавлений и 3 удалений
  1. +2
    -2
      cgi-bin/core/doctype/search_criteria/search_criteria.py
  2. +5
    -1
      cgi-bin/webnotes/utils/nestedset.py

+ 2
- 2
cgi-bin/core/doctype/search_criteria/search_criteria.py Просмотреть файл

@@ -28,7 +28,7 @@ class DocType:

def validate(self):
if sql("select name from `tabSearch Criteria` where criteria_name=%s and name!=%s", (self.doc.criteria_name, self.doc.name)):
webnots.msgprint("Criteria Name '%s' already used, please use another name" % self.doc.criteria_name, raise_exception = 1)
webnotes.msgprint("Criteria Name '%s' already used, please use another name" % self.doc.criteria_name, raise_exception = 1)

def on_update(self):
self.set_module()
@@ -72,4 +72,4 @@ class DocType:
if os.path.exists(os.path.join(path, old_name + extn)):
os.system('cp %s %s' % (os.path.join(path, old_name + extn), \
os.path.join(get_module_path(self.doc.module), 'search_criteria', scrub(self.doc.name), scrub(self.doc.name) + extn)))

+ 5
- 1
cgi-bin/webnotes/utils/nestedset.py Просмотреть файл

@@ -65,7 +65,11 @@ def update_add_node(doctype, name, parent, parent_field):
webnotes.conn.sql("update `tab%s` set rgt = rgt+2 where rgt >= %s" %(doctype,right))
webnotes.conn.sql("update `tab%s` set lft = lft+2 where lft >= %s" %(doctype,right))
#$ update index of new node
# update index of new node
if webnotes.conn.sql("select * from `tab%s` where lft=%s or rgt=%s"% (doctype, right, right+1)):
webnotes.msgprint("Nested set error. Please send mail to support")
raise Exception

webnotes.conn.sql("update `tab%s` set lft=%s, rgt=%s where name='%s'" % (doctype,right,right+1,name))
return right



Загрузка…
Отмена
Сохранить