Просмотр исходного кода

Closes #3706: Increase available_power maximum value on PowerFeed

Jeremy Stretch 6 лет назад
Родитель
Сommit
5aa17bc42a

+ 1 - 0
docs/release-notes/version-2.7.md

@@ -232,6 +232,7 @@ PATCH) to maintain backward compatibility. This behavior will be discontinued be
   scripts
 * [#3655](https://github.com/digitalocean/netbox/issues/3655) - Add `description` field to organizational models
 * [#3664](https://github.com/digitalocean/netbox/issues/3664) - Enable applying configuration contexts by tags
+* [#3706](https://github.com/digitalocean/netbox/issues/3706) - Increase `available_power` maximum value on PowerFeed
 * [#3731](https://github.com/digitalocean/netbox/issues/3731) - Change Graph.type to a ContentType foreign key field
 
 ## API Changes

+ 2 - 2
netbox/dcim/forms.py

@@ -1026,12 +1026,12 @@ class PowerPortTemplateCreateForm(ComponentForm):
     maximum_draw = forms.IntegerField(
         min_value=1,
         required=False,
-        help_text="Maximum current draw (watts)"
+        help_text="Maximum power draw (watts)"
     )
     allocated_draw = forms.IntegerField(
         min_value=1,
         required=False,
-        help_text="Allocated current draw (watts)"
+        help_text="Allocated power draw (watts)"
     )
 
 

+ 18 - 0
netbox/dcim/migrations/0088_powerfeed_available_power.py

@@ -0,0 +1,18 @@
+# Generated by Django 2.2.8 on 2019-12-12 02:09
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('dcim', '0087_role_descriptions'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='powerfeed',
+            name='available_power',
+            field=models.PositiveIntegerField(default=0, editable=False),
+        ),
+    ]

+ 5 - 5
netbox/dcim/models.py

@@ -1260,13 +1260,13 @@ class PowerPortTemplate(ComponentTemplateModel):
         blank=True,
         null=True,
         validators=[MinValueValidator(1)],
-        help_text="Maximum current draw (watts)"
+        help_text="Maximum power draw (watts)"
     )
     allocated_draw = models.PositiveSmallIntegerField(
         blank=True,
         null=True,
         validators=[MinValueValidator(1)],
-        help_text="Allocated current draw (watts)"
+        help_text="Allocated power draw (watts)"
     )
 
     objects = NaturalOrderingManager()
@@ -2182,13 +2182,13 @@ class PowerPort(CableTermination, ComponentModel):
         blank=True,
         null=True,
         validators=[MinValueValidator(1)],
-        help_text="Maximum current draw (watts)"
+        help_text="Maximum power draw (watts)"
     )
     allocated_draw = models.PositiveSmallIntegerField(
         blank=True,
         null=True,
         validators=[MinValueValidator(1)],
-        help_text="Allocated current draw (watts)"
+        help_text="Allocated power draw (watts)"
     )
     _connected_poweroutlet = models.OneToOneField(
         to='dcim.PowerOutlet',
@@ -3316,7 +3316,7 @@ class PowerFeed(ChangeLoggedModel, CableTermination, CustomFieldModel):
         default=80,
         help_text="Maximum permissible draw (percentage)"
     )
-    available_power = models.PositiveSmallIntegerField(
+    available_power = models.PositiveIntegerField(
         default=0,
         editable=False
     )