@@ -1,5 +1,13 @@
# NetBox v2.8
+v2.8.4 (FUTURE)
+
+### Bug Fixes
+* [#4598](https://github.com/netbox-community/netbox/issues/4598) - Display error message when invalid cable length is specified
+---
## v2.8.3 (2020-05-06)
### Bug Fixes
@@ -3659,6 +3659,11 @@ class CableForm(BootstrapMixin, forms.ModelForm):
'type': StaticSelect2,
'length_unit': StaticSelect2,
}
+ error_messages = {
+ 'length': {
+ 'max_value': 'Maximum length is 32767 (any unit)'
+ }
class CableCSVForm(CSVModelForm):
@@ -10,9 +10,23 @@
<label class="col-md-3 control-label" for="id_length">{{ form.length.label }}</label>
<div class="col-md-5">
{{ form.length }}
+ {% if form.length.errors %}
+ <ul>
+ {% for error in form.length.errors %}
+ <li class="text-danger">{{ error }}</li>
+ {% endfor %}
+ </ul>
+ {% endif %}
</div>
<div class="col-md-4">
{{ form.length_unit }}
+ {% if form.length_unit.errors %}
+ {% for error in form.length_unit.errors %}