This commit is contained in:
slav0nic 2009-01-21 18:33:16 +02:00
commit 4cc796a22e
2 changed files with 13 additions and 12 deletions

View file

@ -60,13 +60,13 @@ def notify_topic_subscribers(post):
def notify_pm_recipients(pm):
from apps.forum.models import PrivateMessage
subject = (u'There are new messages')
to_email = pm.dst_user.email
text_content = PM_RECIPIENT_TEXT_TEMPLATE % {
'username': pm.src_user.username,
'message': pm.body_text,
'pm_url': absolute_url(pm.get_absolute_url()),
}
send_mail([to_email], subject, text_content)
if not pm.read:
from apps.forum.models import PrivateMessage
subject = (u'There are new messages')
to_email = pm.dst_user.email
text_content = PM_RECIPIENT_TEXT_TEMPLATE % {
'username': pm.src_user.username,
'message': pm.body_text,
'pm_url': absolute_url(pm.get_absolute_url()),
}
send_mail([to_email], subject, text_content)

View file

@ -648,8 +648,9 @@ def show_pm(request, pm_id):
else:
inbox = False
post_user = msg.dst_user
msg.read = True
msg.save()
if not msg.read:
msg.read = True
msg.save()
return {'msg': msg,
'inbox': inbox,
'post_user': post_user,