From c57cce88818cd2534970890498b1902708d93ad7 Mon Sep 17 00:00:00 2001 From: Bai Date: Fri, 12 Mar 2021 14:57:51 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9system=5Fuser.priorit?= =?UTF-8?q?y=E9=BB=98=E8=AE=A4=E5=80=BC=E4=B8=BA81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/0068_auto_20210312_1455.py | 19 +++++++++++++++++++ apps/assets/models/user.py | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 apps/assets/migrations/0068_auto_20210312_1455.py diff --git a/apps/assets/migrations/0068_auto_20210312_1455.py b/apps/assets/migrations/0068_auto_20210312_1455.py new file mode 100644 index 000000000..28d85ab9d --- /dev/null +++ b/apps/assets/migrations/0068_auto_20210312_1455.py @@ -0,0 +1,19 @@ +# Generated by Django 3.1 on 2021-03-12 06:55 + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('assets', '0067_auto_20210311_1113'), + ] + + operations = [ + migrations.AlterField( + model_name='systemuser', + name='priority', + field=models.IntegerField(default=81, help_text='1-100, the lower the value will be match first', validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(100)], verbose_name='Priority'), + ), + ] diff --git a/apps/assets/models/user.py b/apps/assets/models/user.py index 0145af2f9..e8cf770f5 100644 --- a/apps/assets/models/user.py +++ b/apps/assets/models/user.py @@ -116,7 +116,7 @@ class SystemUser(BaseUser): assets = models.ManyToManyField('assets.Asset', blank=True, verbose_name=_("Assets")) users = models.ManyToManyField('users.User', blank=True, verbose_name=_("Users")) groups = models.ManyToManyField('users.UserGroup', blank=True, verbose_name=_("User groups")) - priority = models.IntegerField(default=20, verbose_name=_("Priority"), help_text=_("1-100, the lower the value will be match first"), validators=[MinValueValidator(1), MaxValueValidator(100)]) + priority = models.IntegerField(default=81, verbose_name=_("Priority"), help_text=_("1-100, the lower the value will be match first"), validators=[MinValueValidator(1), MaxValueValidator(100)]) protocol = models.CharField(max_length=16, choices=PROTOCOL_CHOICES, default='ssh', verbose_name=_('Protocol')) auto_push = models.BooleanField(default=True, verbose_name=_('Auto push')) sudo = models.TextField(default='/bin/whoami', verbose_name=_('Sudo'))