forked from uncloud/uncloud
Fix constraint to active = True
This commit is contained in:
parent
424ceafbb8
commit
721472b416
2 changed files with 2 additions and 2 deletions
|
@ -135,6 +135,6 @@ class Migration(migrations.Migration):
|
|||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='billingaddress',
|
||||
constraint=models.UniqueConstraint(condition=models.Q(primary=True), fields=('owner',), name='one_active_billing_address_per_user'),
|
||||
constraint=models.UniqueConstraint(condition=models.Q(active=True), fields=('owner',), name='one_active_billing_address_per_user'),
|
||||
),
|
||||
]
|
||||
|
|
|
@ -208,7 +208,7 @@ class BillingAddress(models.Model):
|
|||
class Meta:
|
||||
constraints = [
|
||||
models.UniqueConstraint(fields=['owner'],
|
||||
condition=Q(primary=True),
|
||||
condition=Q(active=True),
|
||||
name='one_active_billing_address_per_user')
|
||||
]
|
||||
|
||||
|
|
Loading…
Reference in a new issue