Make account on AssetGroup optional

This commit is contained in:
Mark Veidemanis 2023-02-11 18:18:07 +00:00
parent bdf8f04210
commit ce0b75ae2d
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
2 changed files with 25 additions and 1 deletions

View File

@ -0,0 +1,24 @@
# Generated by Django 4.1.6 on 2023-02-11 18:17
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0056_alter_assetrestriction_pairs_parsed'),
]
operations = [
migrations.AlterField(
model_name='assetgroup',
name='account',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='core.account'),
),
migrations.AlterField(
model_name='assetrestriction',
name='pairs_parsed',
field=models.JSONField(blank=True, default=list, null=True),
),
]

View File

@ -412,7 +412,7 @@ class AssetGroup(models.Model):
description = models.TextField(null=True, blank=True) description = models.TextField(null=True, blank=True)
# Account for checking pairs on children if specified # Account for checking pairs on children if specified
account = models.ForeignKey(Account, on_delete=models.CASCADE) account = models.ForeignKey(Account, on_delete=models.PROTECT, null=True, blank=True)
# Dict like {"RUB": True, "USD": False} # Dict like {"RUB": True, "USD": False}
allowed = models.JSONField(null=True, blank=True, default=dict) allowed = models.JSONField(null=True, blank=True, default=dict)