lingo: make it possible to customize success text (#10623)

This commit is contained in:
Frédéric Péters 2016-05-27 08:41:41 +02:00
parent 8c6b152dfe
commit bc6c0a5d11
3 changed files with 29 additions and 1 deletions

View File

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lingo', '0017_auto_20160327_0831'),
]
operations = [
migrations.AddField(
model_name='regie',
name='text_on_success',
field=models.TextField(null=True, verbose_name='Custom text displayed on success', blank=True),
),
]

View File

@ -84,6 +84,10 @@ class Regie(models.Model):
payment_min_amount = models.DecimalField(_('Minimal payment amount'),
max_digits=7, decimal_places=2, default=0)
text_on_success = models.TextField(
verbose_name=_('Custom text displayed on success'),
blank=True, null=True)
def is_remote(self):
return self.webservice_url != ''
@ -101,6 +105,11 @@ class Regie(models.Model):
def __unicode__(self):
return self.label
def get_text_on_success(self):
if self.text_on_success:
return self.text_on_success
return _('Your payment has been succesfully registered.')
def get_past_items(self, context):
"""
returns past items

View File

@ -329,7 +329,7 @@ class ReturnView(View):
return HttpResponseRedirect(get_basket_url())
if payment_response.result == eopayment.PAID:
messages.info(request, _('Your payment has been succesfully registered.'))
messages.info(request, regie.get_text_on_success())
transaction = Transaction.objects.get(order_id=payment_response.order_id)