fix: 修改资产、授权创建时的小问题

pull/8873/head
Jiangjie.Bai 2022-09-07 18:33:34 +08:00
parent f633a50f8e
commit 746c6e4242
2 changed files with 1 additions and 5 deletions

View File

@ -5,7 +5,3 @@ from django.utils.translation import gettext_lazy as _
class Protocol(models.Model):
name = models.CharField(max_length=32, verbose_name=_("Name"))
port = models.IntegerField(verbose_name=_("Port"))
def save(self, force_insert=False, force_update=False, using=None,
update_fields=None):
pass

View File

@ -111,7 +111,7 @@ class AssetPermissionSerializer(BulkOrgResourceModelSerializer):
# 资产
assets_to_set = Asset.objects.filter(
Q(ip__in=kwargs.get('assets_display')) |
Q(hostname__in=kwargs.get('assets_display'))
Q(name__in=kwargs.get('assets_display'))
).distinct()
instance.assets.add(*assets_to_set)
# 节点