Skip to content

Commit 58fe7eb

Browse files
committed
Don't require to run this in maintenance mode
1 parent 27aeaf2 commit 58fe7eb

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

rbac/migration_tool/migrate.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
import logging
1919

20-
from django.conf import settings
2120
from django.db import transaction
2221
from management.group.relation_api_dual_write_group_handler import RelationApiDualWriteGroupHandler
2322
from management.models import Group
@@ -144,10 +143,8 @@ def migrate_data(
144143
exclude_apps: list = [], orgs: list = [], write_relationships: str = "False", skip_roles: bool = False
145144
):
146145
"""Migrate all data for all tenants."""
147-
# Only run this in maintanence mode or
148-
# if we don't write relationships (testing out the migration and clean up the created bindingmappings)
149-
# TODO: this condition needs to be removed to use migrator without maintenance mode.
150-
if not settings.READ_ONLY_API_MODE and write_relationships != "False":
146+
# Run this if we don't write relationships (testing out the migration and clean up the created bindingmappings)
147+
if write_relationships != "False":
151148
logger.fatal("Read-only API mode is required. READ_ONLY_API_MODE must be set to true.")
152149
return
153150

0 commit comments

Comments
 (0)