Now asset_ids are going to be editable, removed that limitation from form

This commit is contained in:
Matthew Smith
2019-10-05 14:54:19 +01:00
parent 769137fabd
commit a4adc8bc7b

View File

@@ -8,10 +8,6 @@ class AssetForm(forms.ModelForm):
class Meta:
model = models.Asset
fields = '__all__'
def __init__(self, *args, **kwargs):
super(AssetForm, self).__init__(*args, **kwargs)
self.fields['asset_id'].disabled = True #You should not be able to change the asset ID, either in update or create
def clean_date_sold(self):
if self.cleaned_data["date_sold"] and self.cleaned_data["date_acquired"] > self.cleaned_data["date_sold"]: