|
|
@@ -164,6 +164,15 @@ class PowerPortTemplate(ComponentTemplateModel):
|
|
|
allocated_draw=self.allocated_draw
|
|
|
)
|
|
|
|
|
|
+ def clean(self):
|
|
|
+ super().clean()
|
|
|
+
|
|
|
+ if self.maximum_draw is not None and self.allocated_draw is not None:
|
|
|
+ if self.allocated_draw > self.maximum_draw:
|
|
|
+ raise ValidationError({
|
|
|
+ 'allocated_draw': f"Allocated draw cannot exceed the maximum draw ({self.maximum_draw}W)."
|
|
|
+ })
|
|
|
+
|
|
|
|
|
|
class PowerOutletTemplate(ComponentTemplateModel):
|
|
|
"""
|