Merge branch 'master' of github.com:Gluejar/regluit into ry
commit
910ad607ba
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue