Merge branch 'master' of github.com:Gluejar/regluit into ry

pull/1/head
Raymond Yee 2012-05-02 17:20:57 -07:00
commit 910ad607ba
1 changed files with 6 additions and 1 deletions

View File

@ -183,10 +183,15 @@ class Campaign(models.Model):
status = self.status
if status != 'INITIALIZED':
raise UnglueitError(_('Campaign needs to be initialized in order to be activated'))
try:
active_claim = self.work.claim.filter(status="active")[0]
except IndexError, e:
raise UnglueitError(_('Campaign needs to have an active claim in order to be activated'))
self.status= 'ACTIVE'
self.left = self.target
self.save()
active_claim = self.work.claim.filter(status="active")[0]
ungluers = self.work.wished_by()
notification.queue(ungluers, "wishlist_active", {'campaign':self, 'active_claim':active_claim}, True)
return self