fix bug comparing dates with times
parent
e4b3d387fe
commit
0dad79a3d4
|
@ -555,7 +555,7 @@ class Campaign(models.Model):
|
|||
# should be more sophisticated in whether to return True -- look at all the transactions?
|
||||
return True
|
||||
elif self.type==BUY2UNGLUE:
|
||||
if self.cc_date < now():
|
||||
if self.cc_date < date_today():
|
||||
self.status = 'SUCCESSFUL'
|
||||
self.save()
|
||||
action = CampaignAction(campaign=self, type='succeeded', comment = self.current_total)
|
||||
|
|
|
@ -30,7 +30,7 @@ from social_auth.backends.facebook import FacebookBackend
|
|||
regluit imports
|
||||
"""
|
||||
from regluit.payment.signals import transaction_charged, transaction_failed, pledge_modified, pledge_created
|
||||
from regluit.utils.localdatetime import now
|
||||
from regluit.utils.localdatetime import now, date_today
|
||||
from regluit.core.parameters import REWARDS, BUY2UNGLUE, LIBRARY, RESERVE
|
||||
from regluit.libraryauth.models import Library, LibraryUser
|
||||
|
||||
|
@ -204,6 +204,8 @@ def handle_transaction_charged(sender,transaction=None, **kwargs):
|
|||
notification.send([transaction.user], "purchase_complete", {'transaction':transaction}, True)
|
||||
from regluit.core.tasks import watermark_acq
|
||||
watermark_acq.delay(new_acq)
|
||||
if transaction.campaign.cc_date < date_today() :
|
||||
transaction.campaign.update_status(send_notice=True)
|
||||
from regluit.core.tasks import emit_notifications
|
||||
emit_notifications.delay()
|
||||
|
||||
|
|
Loading…
Reference in New Issue