mirror of https://github.com/jumpserver/jumpserver
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
870 B
31 lines
870 B
# Generated by Django 3.1.14 on 2022-03-14 07:25
|
|
|
|
from django.db import migrations
|
|
|
|
|
|
def migrate_old_permissions(apps, *args):
|
|
ContentType = apps.get_model('rbac', 'ContentType')
|
|
content_type_delete_required = [
|
|
('common', 'permission'),
|
|
('applications', 'databaseapp'),
|
|
('applications', 'k8sapp'),
|
|
('applications', 'remoteapp'),
|
|
('perms', 'databaseapppermission'),
|
|
('perms', 'k8sapppermission'),
|
|
('perms', 'remoteapppermission'),
|
|
('authentication', 'loginconfirmsetting'),
|
|
]
|
|
for app, model in content_type_delete_required:
|
|
ContentType.objects.filter(app_label=app, model=model).delete()
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('rbac', '0006_auto_20220310_0616'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.RunPython(migrate_old_permissions)
|
|
]
|