now notifications actually get sent. cleanup to follow.
parent
679f797b74
commit
e197cd6acc
|
@ -92,15 +92,13 @@ def notify_active_campaign(sender, **kwargs):
|
||||||
# what sort of error handling do I need to do here? any?
|
# what sort of error handling do I need to do here? any?
|
||||||
# how do I both ensure that the status is active AND that it was just made active?
|
# how do I both ensure that the status is active AND that it was just made active?
|
||||||
# do i need to send that with the signal?
|
# do i need to send that with the signal?
|
||||||
# let's do the basic version for now and then ask for guidance on style, error-checking
|
|
||||||
# logging?
|
# logging?
|
||||||
campaign = kwargs.get('instance')
|
campaign = kwargs.get('instance')
|
||||||
print "i'm in ur function launchin ur "+campaign.name
|
|
||||||
work = campaign.work
|
work = campaign.work
|
||||||
# assumes only one active claim per campaign. safe?
|
# assumes only one active claim per campaign. safe?
|
||||||
rightsholder = work.claim.filter(status="active")[0].rights_holder.rights_holder_name
|
rightsholder = work.claim.filter(status="active")[0].rights_holder.rights_holder_name
|
||||||
# is this distinct?
|
|
||||||
ungluers = work.wished_by()
|
ungluers = work.wished_by()
|
||||||
notification.queue(ungluers, "active_campaign", {'campaign':campaign, 'work':work, 'rightsholder':rightsholder}, True)
|
notification.queue(ungluers, "active_campaign", {'campaign':campaign, 'work':work, 'rightsholder':rightsholder}, True)
|
||||||
emit_notifications.delay()
|
import regluit.core.tasks as tasks
|
||||||
|
tasks.emit_notifications.delay()
|
||||||
signals.post_save.connect(notify_active_campaign, sender=Campaign)
|
signals.post_save.connect(notify_active_campaign, sender=Campaign)
|
||||||
|
|
|
@ -2,15 +2,11 @@ Congratulations, you wished for it, and now there is an active Campaign for {{ w
|
||||||
|
|
||||||
You can help!
|
You can help!
|
||||||
|
|
||||||
{% comment %}
|
<a href="{% url pledge work_id=work.id %}">Pledge</a> toward ungluing.
|
||||||
<a href="https://{{ site.domain }}/pledge/{{ work.id }}">Pledge</a> toward ungluing.
|
|
||||||
|
|
||||||
Tell your friends -- there are handy share options on the <a href="https://{{ site.domain }}/work/{{ work.id }}">campaign page</a>. There's even a widget you can put on your blog or home page.
|
Tell your friends -- there are handy share options on the <a href="{% url work work.id %}">campaign page</a>. There's even a widget you can put on your blog or home page.
|
||||||
|
|
||||||
<a href="https://{{ site.domain }}/work/{{ work.id }}?tab=2">Join the discussion</a>: share why you love {{ work.title }} and the world will too.
|
<a href="{% url work work.id %}?tab=2">Join the discussion</a>: share why you love {{ work.title }} and the world will too.
|
||||||
|
|
||||||
i'm pretty sure the slashes are breaking the send
|
|
||||||
{% endcomment %}
|
|
||||||
|
|
||||||
Thank you!
|
Thank you!
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<div class="comments clearfix">
|
<div class="comments clearfix">
|
||||||
<div class="comments_book">
|
<div class="comments_book">
|
||||||
<a href="{% url work id %}"><img src="{{ work.cover_image_thumbnail }}" alt="cover image for {{ work.title }}" /></a>
|
<a href="{% url work work.id %}"><img src="{{ work.cover_image_thumbnail }}" alt="cover image for {{ work.title }}" /></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="comments_info">
|
<div class="comments_info">
|
||||||
|
|
Loading…
Reference in New Issue