messages.py use begin/commit for messages

This commit is contained in:
Rushabh Mehta 2013-02-03 22:42:05 +05:30
parent 1af093f6b0
commit 4f8dfd69f9

View File

@ -25,10 +25,12 @@ def get_list(arg=None):
webnotes.form_dict['user'] = webnotes.session['user']
# set all messages as read
webnotes.conn.begin()
webnotes.conn.sql("""UPDATE `tabComment`
set docstatus = 1 where comment_doctype in ('My Company', 'Message')
and comment_docname = %s
""", webnotes.user.name)
webnotes.conn.commit()
if webnotes.form_dict['contact'] == webnotes.session['user']:
# return messages