From 51889bd56741b64e735a60a587cec3420e6cfed7 Mon Sep 17 00:00:00 2001 From: Thomas NOEL Date: Thu, 3 May 2018 11:36:26 +0200 Subject: [PATCH] get_with_indexed_value is now an iterator (#23551) --- auquotidien/modules/abelium_domino_synchro.py | 3 ++- auquotidien/modules/myspace.py | 8 ++++---- auquotidien/modules/payments_ui.py | 8 ++++---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/auquotidien/modules/abelium_domino_synchro.py b/auquotidien/modules/abelium_domino_synchro.py index b821857..7e42a74 100644 --- a/auquotidien/modules/abelium_domino_synchro.py +++ b/auquotidien/modules/abelium_domino_synchro.py @@ -123,7 +123,8 @@ def synchronize_domino(publisher): if getattr(payment_invoice, 'domino_knows_its_paid', None) or getattr(payment_invoice, 'paid_by_domino', None): # synchronization of payment already done, skip continue - transactions = Transaction.get_with_indexed_value('invoice_ids', payment_invoice.id) + transactions = list(Transaction.get_with_indexed_value('invoice_ids', + payment_invoice.id)) if not transactions: logger.warning("domino cron: invoice %s is marked paid but does " "not have any linked transaction.", payment_invoice.id) diff --git a/auquotidien/modules/myspace.py b/auquotidien/modules/myspace.py index 3ec2e06..c3ded9a 100644 --- a/auquotidien/modules/myspace.py +++ b/auquotidien/modules/myspace.py @@ -136,8 +136,8 @@ class StrongboxDirectory(Directory): # TODO: a paragraph of explanations here could be useful - sffiles = StrongboxItem.get_with_indexed_value( - str('user_id'), str(get_request().user.id)) + sffiles = list(StrongboxItem.get_with_indexed_value( + str('user_id'), str(get_request().user.id))) if sffiles: r += htmltext('') r += htmltext('') % ( @@ -332,8 +332,8 @@ class StrongboxDirectory(Directory): return self.picked_file() r = TemplateIO(html=True) root_url = get_publisher().get_root_url() - sffiles = StrongboxItem.get_with_indexed_value( - str('user_id'), str(get_request().user.id)) + sffiles = list(StrongboxItem.get_with_indexed_value( + str('user_id'), str(get_request().user.id))) r += htmltext('

%s

') % _('Pick a file') if not sffiles: diff --git a/auquotidien/modules/payments_ui.py b/auquotidien/modules/payments_ui.py index afb77b5..4bb15df 100644 --- a/auquotidien/modules/payments_ui.py +++ b/auquotidien/modules/payments_ui.py @@ -360,8 +360,8 @@ class RegieDirectory(Directory): def get_invoices(self): sort_by = self.get_sort_by() - invoices = Invoice.get_with_indexed_value('regie_id', self.regie.id, - ignore_errors=True) + invoices = list(Invoice.get_with_indexed_value('regie_id', self.regie.id, + ignore_errors=True)) if 'date' in sort_by: reverse = True key = lambda i: getattr(i, sort_by) or datetime.datetime.now() @@ -456,8 +456,8 @@ class RegieDirectory(Directory): r += htmltext('') r += htmltext('') - transactions = Transaction.get_with_indexed_value('invoice_ids', - invoice.id) + transactions = list(Transaction.get_with_indexed_value('invoice_ids', + invoice.id)) for transaction in sorted(transactions, key=lambda x: x.start): r += htmltext('') r += htmltext('') -- 2.17.0
%s%s