lingo: make URL static in TipiPaymentFormCell (#55244)

This commit is contained in:
Benjamin Dauvergne 2021-06-28 18:51:54 +02:00
parent ed10d440fd
commit 6668215594
2 changed files with 21 additions and 3 deletions

View File

@ -0,0 +1,17 @@
# Generated by Django 2.2.19 on 2021-06-28 16:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lingo', '0042_text_to_jsonb'),
]
operations = [
migrations.RemoveField(
model_name='tipipaymentformcell',
name='url',
),
]

View File

@ -1285,9 +1285,6 @@ TIPI_CONTROL_PROCOTOLS = (
@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.payfip.gouv.fr/tpa/paiement.web'
)
regies = models.CharField(
_('Regies'),
help_text=_(
@ -1324,6 +1321,10 @@ class TipiPaymentFormCell(CellBase):
class Media:
js = ('js/tipi.js',)
@property
def url(self):
return getattr(settings, 'LINGO_TIPI_CELL_PAYMENT_URL', 'https://www.payfip.gouv.fr/tpa/paiement.web')
def get_cell_extra_context(self, context):
extra_context = super(TipiPaymentFormCell, self).get_cell_extra_context(context)
form_fields = self.get_default_form_class().base_fields