fixed asset_group delete html

pull/530/head
Webb 8 years ago
parent a6825ac91e
commit 63fd3cfff2

@ -37,13 +37,13 @@ class AssetCreateForm(forms.ModelForm):
self.instance.tags.clear()
self.instance.tags.add(*tuple(tags))
def clean(self):
clean_data = super(AssetCreateForm, self).clean()
ip = clean_data.get('ip')
port = clean_data.get('port')
query = Asset.objects.filter(ip=ip, port=port)
if query:
raise forms.ValidationError('this asset has exists.')
# def clean(self):
# clean_data = super(AssetCreateForm, self).clean()
# ip = clean_data.get('ip')
# port = clean_data.get('port')
# query = Asset.objects.filter(ip=ip, port=port)
# if query:
# raise forms.ValidationError('this asset has exists.')
class Meta:
model = Asset

@ -70,7 +70,9 @@ $(document).ready(function(){
var uid = $this.data('uid');
var the_url = '{% url "api-assets:asset-group-detail" pk=99991937 %}'.replace('99991937', uid);
objectDelete($this, name, the_url);
setTimeout( function () {
$data_table.ajax.reload();
}, 3000);
})
.on('click', '#btn_bulk_update', function () {

@ -148,16 +148,16 @@ class AssetUpdateView(AdminUserRequiredMixin, UpdateAssetTagsMiXin, UpdateView):
# for i in prn_obj_key(form):
# if i not in self.new_form.keys():
# print i
#
# #delattr(asset, '"%s" % i')
# #del asset.i
# asset.save()
# asset.id = 27
# # asset.created_by = self.request.user.username or 'Admin'
# asset.save()
# asset.id = 28
# asset.save()
# return super(AssetUpdateView, self).form_valid(form)
#delattr(asset, '"%s" % i')
#del asset.i
asset.save()
asset.id = 27
# asset.created_by = self.request.user.username or 'Admin'
asset.save()
asset.id = 28
asset.save()
return super(AssetUpdateView, self).form_valid(form)
class AssetDeleteView(DeleteView):

Loading…
Cancel
Save