From 68b376d3f3a832307fb7f2ee7c374fc638580e80 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Tue, 23 Jul 2019 12:06:12 +0200 Subject: [PATCH 2/2] lingo: PEP8ize TipiPaymentFormCell (#35008) --- combo/apps/lingo/models.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/combo/apps/lingo/models.py b/combo/apps/lingo/models.py index b4c9c65..0619967 100644 --- a/combo/apps/lingo/models.py +++ b/combo/apps/lingo/models.py @@ -722,12 +722,14 @@ TIPI_CONTROL_PROCOTOLS = ( ('rolmre', _('ROLMRE')), ) + @register_cell_class class TipiPaymentFormCell(CellBase): title = models.CharField(_('Title'), max_length=150, blank=True) url = models.URLField(_('TIPI payment service URL'), default='https://www.tipi.budget.gouv.fr/tpa/paiement.web') regies = models.CharField(_('Regies'), help_text=_('separated by commas'), max_length=256) - control_protocol = models.CharField(_('Control protocol'), max_length=8, choices=TIPI_CONTROL_PROCOTOLS, default='pesv2') + control_protocol = models.CharField(_('Control protocol'), max_length=8, choices=TIPI_CONTROL_PROCOTOLS, + default='pesv2') exer = models.CharField('Exer', max_length=4, blank=True, help_text=_('Default value to be used in form')) idpce = models.CharField('IDPCE', max_length=8, blank=True, help_text=_('Default value to be used in form')) idligne = models.CharField('IDLIGNE', max_length=6, blank=True, help_text=_('Default value to be used in form')) @@ -767,10 +769,13 @@ class TipiPaymentFormCell(CellBase): # special pattern for rolrec if field == 'rolrec': field_pattern = '[A-Z0-9]+' - reference_fields.append({'name': field, 'length': form_fields[field].max_length, - 'placeholder': '0'*form_fields[field].max_length, - 'pattern': field_pattern, - 'protocol': definition['protocol']}) + reference_fields.append({ + 'name': field, + 'length': form_fields[field].max_length, + 'placeholder': '0' * form_fields[field].max_length, + 'pattern': field_pattern, + 'protocol': definition['protocol'] + }) context['title'] = self.title context['url'] = self.url context['mode'] = 'T' if self.test_mode else 'M' -- 2.22.0