Bläddra i källkod

Merge pull request #400 from nabinhait/hotfix

Delete notification count for messages, after read or post
version-14
Nabin Hait 11 år sedan
förälder
incheckning
ea682cc15a
1 ändrade filer med 7 tillägg och 0 borttagningar
  1. +7
    -0
      core/page/messages/messages.py

+ 7
- 0
core/page/messages/messages.py Visa fil

@@ -3,6 +3,8 @@


from __future__ import unicode_literals from __future__ import unicode_literals
import webnotes import webnotes
from core.doctype.notification_count.notification_count import delete_notification_count_for



@webnotes.whitelist() @webnotes.whitelist()
def get_list(arg=None): def get_list(arg=None):
@@ -17,6 +19,9 @@ def get_list(arg=None):
set docstatus = 1 where comment_doctype in ('My Company', 'Message') set docstatus = 1 where comment_doctype in ('My Company', 'Message')
and comment_docname = %s and comment_docname = %s
""", webnotes.user.name) """, webnotes.user.name)
delete_notification_count_for("Messages")
webnotes.conn.commit() webnotes.conn.commit()


if webnotes.form_dict['contact'] == webnotes.session['user']: if webnotes.form_dict['contact'] == webnotes.session['user']:
@@ -69,6 +74,8 @@ def post(arg=None):
d.comment_docname = arg['contact'] d.comment_docname = arg['contact']
d.comment_doctype = 'Message' d.comment_doctype = 'Message'
d.save() d.save()
delete_notification_count_for("Messages")


import webnotes.utils import webnotes.utils
if webnotes.utils.cint(arg.get('notify')): if webnotes.utils.cint(arg.get('notify')):


Laddar…
Avbryt
Spara