Add limit_choices_to on scope_type

This commit is contained in:
Jeremy Stretch 2024-10-16 10:00:02 -04:00
parent 88ada4758d
commit b3263d8cf4
2 changed files with 2 additions and 0 deletions

View File

@ -35,6 +35,7 @@ class Migration(migrations.Migration):
name='scope_type',
field=models.ForeignKey(
blank=True,
limit_choices_to=models.Q(('model__in', ('region', 'sitegroup', 'site', 'location'))),
null=True,
on_delete=django.db.models.deletion.PROTECT,
related_name='+',

View File

@ -211,6 +211,7 @@ class Prefix(ContactsMixin, GetAvailablePrefixesMixin, PrimaryModel):
scope_type = models.ForeignKey(
to='contenttypes.ContentType',
on_delete=models.PROTECT,
limit_choices_to=Q(model__in=PREFIX_SCOPE_TYPES),
related_name='+',
blank=True,
null=True