瀏覽代碼

fixes to about us

version-14
Rushabh Mehta 12 年之前
父節點
當前提交
4a76d8f425
共有 2 個檔案被更改,包括 6 行新增3 行删除
  1. +4
    -3
      webnotes/db.py
  2. +2
    -0
      webnotes/model/bean.py

+ 4
- 3
webnotes/db.py 查看文件

@@ -341,11 +341,12 @@ class Database:
if self.sql("select value from tabSingles where field=%s and doctype=%s", (field, dt)): if self.sql("select value from tabSingles where field=%s and doctype=%s", (field, dt)):
self.sql("""update tabSingles set value=%s where field=%s and doctype=%s""", self.sql("""update tabSingles set value=%s where field=%s and doctype=%s""",
(val, field, dt)) (val, field, dt))
self.sql("""update tabSingles set value=%s where field="modified" and doctype=%s""",
(now(), dt))
else: else:
self.sql("""insert into tabSingles(doctype, field, value) self.sql("""insert into tabSingles(doctype, field, value)
values (%s, %s, %s), (%s, "modified", %s)""", (dt, field, val, dt, modified or now()))
values (%s, %s, %s)""", (dt, field, val, ))
if field!="modified":
self.set_value(dt, dn, "modified", modified or now())
def set(self, doc, field, val): def set(self, doc, field, val):
from webnotes.utils import now from webnotes.utils import now


+ 2
- 0
webnotes/model/bean.py 查看文件

@@ -114,6 +114,8 @@ class Bean:
if not cint(self.doc.fields.get('__islocal')): if not cint(self.doc.fields.get('__islocal')):
if is_single(self.doc.doctype): if is_single(self.doc.doctype):
modified = webnotes.conn.get_value(self.doc.doctype, self.doc.name, "modified") modified = webnotes.conn.get_value(self.doc.doctype, self.doc.name, "modified")
if isinstance(modified, list):
modified = modified[0]
if cstr(modified) and cstr(modified) != cstr(self.doc.modified): if cstr(modified) and cstr(modified) != cstr(self.doc.modified):
conflict = True conflict = True
else: else:


Loading…
取消
儲存