mirror of https://gitlab.federez.net/re2o/re2o
7 changed files with 104 additions and 65 deletions
@ -0,0 +1,35 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10.7 on 2018-07-03 17:02 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
def create_max_balance(apps, schema_editor): |
|||
OptionalUser = apps.get_model('preferences', 'OptionalUser') |
|||
Payment = apps.get_model('cotisations', 'Paiement') |
|||
|
|||
balance, _created = Payment.objects.get_or_create(moyen='solde') |
|||
options, _created = OptionalUser.objects.get_or_create() |
|||
|
|||
balance.maximum_balance = options.max_solde |
|||
balance.save() |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('cotisations', '0036_auto_20180703_1056'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterModelOptions( |
|||
name='paiement', |
|||
options={'permissions': (('view_paiement', "Can see a payement's details"), ('use_every_payment', 'Can use every payement')), 'verbose_name': 'Payment method', 'verbose_name_plural': 'Payment methods'}, |
|||
), |
|||
migrations.AddField( |
|||
model_name='balancepayment', |
|||
name='maximum_balance', |
|||
field=models.DecimalField(decimal_places=2, default=50, help_text='The maximal amount of money allowed for the balance.', max_digits=5, verbose_name='Maximum balance'), |
|||
), |
|||
migrations.RunPython(create_max_balance) |
|||
] |
|||
Loading…
Reference in new issue