Created
June 11, 2014 10:16
-
-
Save drager/679c829ceb49d4873d48 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from django.template.defaultfilters import slugify | |
from django.core.urlresolvers import reverse | |
from notifications import notify | |
def notify_topic_subscribers(post): | |
topic = post.topic | |
for user in topic.subscribers.all(): | |
if user != post.author and user != post.topic.author: | |
notify.send(post.author, recipient=user, | |
verb=u'gjorde ett inlägg i tråden', action_object=post.topic, | |
description=post.bodytext, target=post.topic, | |
actions={'href': reverse('forum:topic_detail', | |
args=(post.topic.forum.slug, post.topic.id, post.topic.slug)) + "#post" + str(post.id)}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment