Browse Source

fix(assets): 修复用户name字段长度与资产created_by字段长度不一致导致创建资产失败的问题 (#4302)

* fix(assets): 修复用户name字段长度与资产created_by字段长度不一致导致创建资产失败的问题

* fix(assets): 修复用户name字段长度与资产created_by字段长度不一致导致创建资产失败的问题(修改迁移文件名称 0050_auto_20200702_1602.py -> 0051_auto_20200713_1143.py)
pull/4307/head
BaiJiangJie 4 years ago committed by GitHub
parent
commit
724a8f6324
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      apps/assets/migrations/0050_auto_20200711_1740.py
  2. 4
      apps/assets/migrations/0051_auto_20200713_1143.py
  3. 2
      apps/assets/models/asset.py

18
apps/assets/migrations/0050_auto_20200711_1740.py

@ -0,0 +1,18 @@
# Generated by Django 2.2.10 on 2020-07-11 09:40
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('assets', '0049_systemuser_sftp_root'),
]
operations = [
migrations.AlterField(
model_name='asset',
name='created_by',
field=models.CharField(blank=True, max_length=128, null=True, verbose_name='Created by'),
),
]

4
apps/assets/migrations/0050_auto_20200702_1602.py → apps/assets/migrations/0051_auto_20200713_1143.py

@ -1,4 +1,4 @@
# Generated by Django 2.2.10 on 2020-07-02 08:02
# Generated by Django 2.2.10 on 2020-07-13 03:43
from django.db import migrations, models
@ -6,7 +6,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('assets', '0049_systemuser_sftp_root'),
('assets', '0050_auto_20200711_1740'),
]
operations = [

2
apps/assets/models/asset.py

@ -221,7 +221,7 @@ class Asset(ProtocolsMixin, NodesRelationMixin, OrgModelMixin):
hostname_raw = models.CharField(max_length=128, blank=True, null=True, verbose_name=_('Hostname raw'))
labels = models.ManyToManyField('assets.Label', blank=True, related_name='assets', verbose_name=_("Labels"))
created_by = models.CharField(max_length=32, null=True, blank=True, verbose_name=_('Created by'))
created_by = models.CharField(max_length=128, null=True, blank=True, verbose_name=_('Created by'))
date_created = models.DateTimeField(auto_now_add=True, null=True, blank=True, verbose_name=_('Date created'))
comment = models.TextField(max_length=128, default='', blank=True, verbose_name=_('Comment'))

Loading…
Cancel
Save