mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-24 09:28:38 -06:00
14401 validate rack startion position > 0
This commit is contained in:
parent
d10ac9b4a7
commit
d2c3a39ebb
18
netbox/dcim/migrations/0182_alter_rack_starting_unit.py
Normal file
18
netbox/dcim/migrations/0182_alter_rack_starting_unit.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 4.2.5 on 2023-12-05 19:13
|
||||||
|
|
||||||
|
import django.core.validators
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
dependencies = [
|
||||||
|
('dcim', '0181_rename_device_role_device_role'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='rack',
|
||||||
|
name='starting_unit',
|
||||||
|
field=models.PositiveSmallIntegerField(default=1, validators=[django.core.validators.MinValueValidator(1)]),
|
||||||
|
),
|
||||||
|
]
|
@ -141,6 +141,7 @@ class Rack(ContactsMixin, ImageAttachmentsMixin, PrimaryModel, WeightMixin):
|
|||||||
starting_unit = models.PositiveSmallIntegerField(
|
starting_unit = models.PositiveSmallIntegerField(
|
||||||
default=RACK_STARTING_UNIT_DEFAULT,
|
default=RACK_STARTING_UNIT_DEFAULT,
|
||||||
verbose_name=_('starting unit'),
|
verbose_name=_('starting unit'),
|
||||||
|
validators=[MinValueValidator(1),],
|
||||||
help_text=_('Starting unit for rack')
|
help_text=_('Starting unit for rack')
|
||||||
)
|
)
|
||||||
desc_units = models.BooleanField(
|
desc_units = models.BooleanField(
|
||||||
|
Loading…
Reference in New Issue
Block a user