mirror of https://gitlab.federez.net/re2o/re2o
10 changed files with 104 additions and 15 deletions
@ -0,0 +1,29 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10.7 on 2018-07-04 16:30 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
def update_balance(apps, _): |
|||
Payment = apps.get_model('cotisations', 'Paiement') |
|||
try: |
|||
balance = Payment.objects.get(moyen="solde") |
|||
balance.is_balance = True |
|||
balance.save() |
|||
except Payment.DoesNotExist: |
|||
pass |
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('cotisations', '0037_auto_20180703_1202'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='paiement', |
|||
name='is_balance', |
|||
field=models.BooleanField(default=False, editable=False, help_text='There should be only one balance payment method.', verbose_name='Is user balance'), |
|||
), |
|||
migrations.RunPython(update_balance) |
|||
] |
|||
@ -0,0 +1,21 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10.7 on 2018-07-04 16:47 |
|||
from __future__ import unicode_literals |
|||
|
|||
import cotisations.models |
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('cotisations', '0038_paiement_is_balance'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='paiement', |
|||
name='is_balance', |
|||
field=models.BooleanField(default=False, editable=False, help_text='There should be only one balance payment method.', validators=[cotisations.models.check_no_balance], verbose_name='Is user balance'), |
|||
), |
|||
] |
|||
Loading…
Reference in new issue