mirror of https://github.com/jumpserver/jumpserver
fix: 修改命令过滤规则动作允许值1->9
parent
facc231e3f
commit
ac14790960
|
@ -0,0 +1,27 @@
|
||||||
|
# Generated by Django 3.1.13 on 2021-12-15 06:36
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
OLD_ACTION_ALLOW = 1
|
||||||
|
NEW_ACTION_ALLOW = 9
|
||||||
|
|
||||||
|
|
||||||
|
def migrate_action(apps, schema_editor):
|
||||||
|
model = apps.get_model("assets", "CommandFilterRule")
|
||||||
|
model.objects.filter(action=OLD_ACTION_ALLOW).update(action=NEW_ACTION_ALLOW)
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('assets', '0082_auto_20211209_1440'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RunPython(migrate_action),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='commandfilterrule',
|
||||||
|
name='action',
|
||||||
|
field=models.IntegerField(choices=[(0, 'Deny'), (9, 'Allow'), (2, 'Reconfirm')], default=0, verbose_name='Action'),
|
||||||
|
),
|
||||||
|
]
|
|
@ -68,7 +68,7 @@ class CommandFilterRule(OrgModelMixin):
|
||||||
|
|
||||||
class ActionChoices(models.IntegerChoices):
|
class ActionChoices(models.IntegerChoices):
|
||||||
deny = 0, _('Deny')
|
deny = 0, _('Deny')
|
||||||
allow = 1, _('Allow')
|
allow = 9, _('Allow')
|
||||||
confirm = 2, _('Reconfirm')
|
confirm = 2, _('Reconfirm')
|
||||||
|
|
||||||
id = models.UUIDField(default=uuid.uuid4, primary_key=True)
|
id = models.UUIDField(default=uuid.uuid4, primary_key=True)
|
||||||
|
|
Loading…
Reference in New Issue