From e978308335c816e49ab9e570006e340cef9a1acb Mon Sep 17 00:00:00 2001 From: BaiJiangJie Date: Fri, 20 Dec 2019 17:36:06 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20=E4=BF=AE=E6=94=B9Adhoc=E5=AD=97?= =?UTF-8?q?=E6=AE=B5become=E5=8F=AF=E4=BB=A5=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/ops/migrations/0010_auto_20191217_1758.py | 2 +- apps/ops/models/adhoc.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/ops/migrations/0010_auto_20191217_1758.py b/apps/ops/migrations/0010_auto_20191217_1758.py index 7e999a33b..a9a1555c0 100644 --- a/apps/ops/migrations/0010_auto_20191217_1758.py +++ b/apps/ops/migrations/0010_auto_20191217_1758.py @@ -18,7 +18,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='adhoc', name='_become', - field=common.fields.model.EncryptJsonDictCharField(blank=True, default='', max_length=1024, verbose_name='Become'), + field=common.fields.model.EncryptJsonDictCharField(blank=True, null=True, default='', max_length=1024, verbose_name='Become'), ), migrations.AlterField( model_name='adhoc', diff --git a/apps/ops/models/adhoc.py b/apps/ops/models/adhoc.py index 3e0220b68..73dfd4339 100644 --- a/apps/ops/models/adhoc.py +++ b/apps/ops/models/adhoc.py @@ -185,7 +185,7 @@ class AdHoc(models.Model): hosts = models.ManyToManyField('assets.Asset', verbose_name=_("Host")) run_as_admin = models.BooleanField(default=False, verbose_name=_('Run as admin')) run_as = models.CharField(max_length=64, default='', blank=True, null=True, verbose_name=_('Username')) - become = EncryptJsonDictCharField(max_length=1024, default='', blank=True, verbose_name=_("Become")) + become = EncryptJsonDictCharField(max_length=1024, default='', null=True, blank=True, verbose_name=_("Become")) created_by = models.CharField(max_length=64, default='', blank=True, null=True, verbose_name=_('Create by')) date_created = models.DateTimeField(auto_now_add=True, db_index=True)