From a425ece865ce9fbfe6c3ee9723188b641506c8b6 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Sat, 7 Jan 2017 14:41:07 +0100 Subject: [PATCH] use misc.compute() instead of kflowStatusItem.compute() --- extra/modules/clicrdv.py | 4 ++-- extra/modules/payments.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/extra/modules/clicrdv.py b/extra/modules/clicrdv.py index 2dfd8ab..ec88d81 100644 --- a/extra/modules/clicrdv.py +++ b/extra/modules/clicrdv.py @@ -11,7 +11,7 @@ import time import vobject from qommon import get_cfg -from qommon.misc import format_time +from qommon.misc import format_time, compute from qommon.form import * from wcs.data_sources import register_data_source_function @@ -243,7 +243,7 @@ class ClicRdvCreateAppointment(WorkflowStatusItem): def perform(self, formdata): args = {} for parameter in self.get_parameters(): - args[parameter] = self.compute(getattr(self, parameter)) + args[parameter] = compute(getattr(self, parameter)) if not args.get(parameter): del args[parameter] message = {'appointment': diff --git a/extra/modules/payments.py b/extra/modules/payments.py index cb97a6e..956bc28 100644 --- a/extra/modules/payments.py +++ b/extra/modules/payments.py @@ -25,7 +25,7 @@ from qommon import errors, get_logger, get_cfg, emails from qommon.storage import StorableObject from qommon.form import htmltext, StringWidget, TextWidget, SingleSelectWidget, \ WidgetDict -from qommon.misc import simplify +from qommon.misc import simplify, compute from wcs.formdef import FormDef from wcs.formdata import Evolution @@ -273,13 +273,13 @@ class PaymentWorkflowStatusItem(WorkflowStatusItem): invoice.formdata_id = formdata.id invoice.next_status = self.next_status if self.subject: - invoice.subject = template_on_formdata(formdata, self.compute(self.subject)) + invoice.subject = template_on_formdata(formdata, compute(self.subject)) else: invoice.subject = _('%(form_name)s #%(formdata_id)s') % { 'form_name': formdata.formdef.name, 'formdata_id': formdata.id } - invoice.details = template_on_formdata(formdata, self.compute(self.details)) - invoice.amount = Decimal(self.compute(self.amount)) + invoice.details = template_on_formdata(formdata, compute(self.details)) + invoice.amount = Decimal(compute(self.amount)) invoice.date = dt.now() invoice.request_kwargs = {} if self.request_kwargs: -- 2.1.4