fix bug comparing dates with times

pull/1/head
eric 2013-11-14 12:38:58 -05:00
parent e4b3d387fe
commit 0dad79a3d4
2 changed files with 4 additions and 2 deletions

View File

@ -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)

View File

@ -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()