mirror of https://github.com/jumpserver/jumpserver
[Bugfix] 修复资产列表导入,资产id问题
parent
c37414045b
commit
2823d02763
|
@ -304,7 +304,10 @@ class BulkImportAssetView(AdminUserRequiredMixin, JSONResponseMixin, FormView):
|
||||||
if v != '':
|
if v != '':
|
||||||
asset_dict[k] = v
|
asset_dict[k] = v
|
||||||
|
|
||||||
asset = get_object_or_none(Asset, id=asset_dict.pop('id', 0))
|
asset = None
|
||||||
|
asset_id = asset_dict.pop('id', None)
|
||||||
|
if asset_id:
|
||||||
|
asset = get_object_or_none(Asset, id=asset_id)
|
||||||
if not asset:
|
if not asset:
|
||||||
try:
|
try:
|
||||||
if len(Asset.objects.filter(hostname=asset_dict.get('hostname'))):
|
if len(Asset.objects.filter(hostname=asset_dict.get('hostname'))):
|
||||||
|
|
Loading…
Reference in New Issue