Created
December 17, 2014 08:09
-
-
Save hodgestar/78e06cfd8775c6a5d293 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/go/billing/tasks.py b/go/billing/tasks.py | |
index ec2b0e8..dc7ad13 100644 | |
--- a/go/billing/tasks.py | |
+++ b/go/billing/tasks.py | |
@@ -271,7 +271,7 @@ def archive_transactions(account_id, from_date, to_date, delete=True): | |
"to": to_date, | |
}) | |
- transaction_list = Transaction.objects.filter( | |
+ transaction_query = Transaction.objects.filter( | |
account_number=account.account_number, | |
created__gte=from_date, | |
created__lt=(to_date + relativedelta(days=1))) | |
@@ -289,7 +289,7 @@ def archive_transactions(account_id, from_date, to_date, delete=True): | |
yield sep | |
bucket = Bucket('billing.archive') | |
- chunks = generate_chunks(transaction_list) | |
+ chunks = generate_chunks(transaction_query.iterator()) | |
archive = TransactionArchive( | |
account=account, filename=filename, | |
@@ -305,7 +305,7 @@ def archive_transactions(account_id, from_date, to_date, delete=True): | |
archive.save() | |
if delete: | |
- transaction_list.delete() | |
+ transaction_query.delete() | |
archive.status = TransactionArchive.STATUS_ARCHIVE_COMPLETED | |
archive.save() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment