File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
openwisp_controller/config/migrations Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 11from django .db import migrations
22import json
33
4+
45def change_owzt_to_global (apps , schema_editor ):
56 Template = apps .get_model ('config' , 'Template' )
6- for template in Template .objects .filter (type = 'vpn' ,vpn__backend = 'openwisp_controller.vpn_backends.ZeroTier' ):
7+ for template in Template .objects .filter (
8+ type = 'vpn' , vpn__backend = 'openwisp_controller.vpn_backends.ZeroTier' ):
79 config = json .loads (template .config )
810 if 'zerotier' in config :
9- for item in config .get ('zerotier' ,[]):
11+ for item in config .get ('zerotier' , []):
1012 if item .get ('name' ) == 'ow_zt' :
1113 item ['name' ] = 'global'
1214
15+
1316class Migration (migrations .Migration ):
1417 dependencies = [('config' , '0055_alter_config_status' )]
1518
1619 operations = [
17- migrations .RunPython (change_owzt_to_global , reverse_code = migrations .RunPython .noop )
20+ migrations .RunPython (
21+ change_owzt_to_global , reverse_code = migrations .RunPython .noop )
1822 ]
You can’t perform that action at this time.
0 commit comments