Added form validation

* Asset IDs must be unique
* Asset IDs that are legacy and unchange have no validation applied
* Asset IDs must be alphanumeric
* Values must be >=0
* Lengths, CSAs, Circuits and Cores of cables must all be >0
This commit is contained in:
Matthew Smith
2019-10-08 22:33:41 +01:00
parent 1d6208414f
commit b7e14b7dc3
5 changed files with 89 additions and 7 deletions

View File

@@ -74,7 +74,6 @@ class AssetEdit(LoginRequiredMixin, generic.UpdateView):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['form'] = forms.AssetForm
context['edit'] = True
return context