Skip to content

Commit 8d41165

Browse files
authored
[migrations] Flake8 migration + swapper fix #263
Closes #263
1 parent a69ea4b commit 8d41165

19 files changed

+229
-67
lines changed

openwisp_controller/config/migrations/0001_squashed_0002_config_settings_uuid.py

Lines changed: 45 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ class Migration(migrations.Migration):
4949
('netjsonconfig.OpenWrt', 'OpenWRT'),
5050
('netjsonconfig.OpenWisp', 'OpenWISP Firmware 1.x'),
5151
],
52-
help_text='Select <a href="http://netjsonconfig.openwisp.org/en/stable/" target="_blank">netjsonconfig</a> backend',
52+
help_text=(
53+
'Select <a href="http://netjsonconfig.openwisp.org'
54+
'/en/stable/" target="_blank">netjsonconfig</a> '
55+
'backend'
56+
),
5357
max_length=128,
5458
verbose_name='backend',
5559
),
@@ -90,7 +94,11 @@ class Migration(migrations.Migration):
9094
('error', 'error'),
9195
],
9296
default='modified',
93-
help_text='modified means the configuration is not applied yet; running means applied and running; error means the configuration caused issues and it was rolledback',
97+
help_text=(
98+
'modified means the configuration is not applied '
99+
'yet; running means applied and running; error means the '
100+
'configuration caused issues and it was rolledback'
101+
),
94102
max_length=100,
95103
no_check_for_status=True,
96104
),
@@ -100,7 +108,9 @@ class Migration(migrations.Migration):
100108
models.CharField(
101109
db_index=True,
102110
default=openwisp_utils.utils.get_random_key,
103-
help_text='unique key that can be used to download the configuration',
111+
help_text=(
112+
'unique key that can be used to download the configuration'
113+
),
104114
max_length=64,
105115
unique=True,
106116
validators=[
@@ -133,7 +143,11 @@ class Migration(migrations.Migration):
133143
'last_ip',
134144
models.GenericIPAddressField(
135145
blank=True,
136-
help_text='indicates the last ip from which the configuration was downloaded from (except downloads from this page)',
146+
help_text=(
147+
'indicates the last ip from which the '
148+
'configuration was downloaded from (except '
149+
'downloads from this page)'
150+
),
137151
null=True,
138152
),
139153
),
@@ -168,7 +182,10 @@ class Migration(migrations.Migration):
168182
'registration_enabled',
169183
models.BooleanField(
170184
default=True,
171-
help_text='Whether automatic registration of devices is enabled or not',
185+
help_text=(
186+
'Whether automatic registration of devices is '
187+
'enabled or not'
188+
),
172189
verbose_name='auto-registration enabled',
173190
),
174191
),
@@ -184,7 +201,10 @@ class Migration(migrations.Migration):
184201
django.core.validators.RegexValidator(
185202
re.compile('^[^\\s/\\.]+$'),
186203
code='invalid',
187-
message='This value must not contain spaces, dots or slashes.',
204+
message=(
205+
'This value must not contain spaces, dots '
206+
'or slashes.'
207+
),
188208
)
189209
],
190210
verbose_name='shared secret',
@@ -225,7 +245,10 @@ class Migration(migrations.Migration):
225245
('netjsonconfig.OpenWrt', 'OpenWRT'),
226246
('netjsonconfig.OpenWisp', 'OpenWISP Firmware 1.x'),
227247
],
228-
help_text='Select <a href="http://netjsonconfig.openwisp.org/en/stable/" target="_blank">netjsonconfig</a> backend',
248+
help_text=(
249+
'Select <a href="http://netjsonconfig.openwisp.org'
250+
'/en/stable/" target="_blank">netjsonconfig</a> backend'
251+
),
229252
max_length=128,
230253
verbose_name='backend',
231254
),
@@ -263,7 +286,9 @@ class Migration(migrations.Migration):
263286
choices=[('generic', 'Generic'), ('vpn', 'VPN-client')],
264287
db_index=True,
265288
default='generic',
266-
help_text='template type, determines which features are available',
289+
help_text=(
290+
'template type, determines which features are available'
291+
),
267292
max_length=16,
268293
verbose_name='type',
269294
),
@@ -273,16 +298,25 @@ class Migration(migrations.Migration):
273298
models.BooleanField(
274299
db_index=True,
275300
default=False,
276-
help_text='whether new configurations will have this template enabled by default',
301+
help_text=(
302+
'whether new configurations will have this '
303+
'template enabled by default'
304+
),
277305
verbose_name='enabled by default',
278306
),
279307
),
280308
(
281309
'auto_cert',
282310
models.BooleanField(
283311
db_index=True,
284-
default=openwisp_controller.config.base.template.default_auto_cert,
285-
help_text='whether x509 client certificates should be automatically managed behind the scenes for each configuration using this template, valid only for the VPN type',
312+
default=(
313+
openwisp_controller.config.base.template.default_auto_cert
314+
),
315+
help_text=(
316+
'whether x509 client certificates should be automatically '
317+
'managed behind the scenes for each configuration '
318+
'using this template, valid only for the VPN type'
319+
),
286320
verbose_name='auto certificate',
287321
),
288322
),

openwisp_controller/config/migrations/0003_template_tags.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,11 @@ class Migration(migrations.Migration):
8888
name='tags',
8989
field=taggit.managers.TaggableManager(
9090
blank=True,
91-
help_text='A comma-separated list of template tags, may be used to ease auto configuration with specific settings (eg: 4G, mesh, WDS, VPN, ecc.)',
91+
help_text=(
92+
'A comma-separated list of template tags, may '
93+
'be used to ease auto configuration with specific '
94+
'settings (eg: 4G, mesh, WDS, VPN, ecc.)'
95+
),
9296
through='config.TaggedTemplate',
9397
to='config.TemplateTag',
9498
verbose_name='Tags',

openwisp_controller/config/migrations/0004_add_device_model.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ class Migration(migrations.Migration):
6363
django.core.validators.RegexValidator(
6464
re.compile('^[^\\s/\\.]+$'),
6565
code='invalid',
66-
message='This value must not contain spaces, dots or slashes.',
66+
message=(
67+
'This value must not contain spaces, dots or '
68+
'slashes.'
69+
),
6770
)
6871
],
6972
),
@@ -111,7 +114,7 @@ class Migration(migrations.Migration):
111114
),
112115
),
113116
],
114-
options={'abstract': False,},
117+
options={'abstract': False},
115118
),
116119
migrations.AddField(
117120
model_name='config',

openwisp_controller/config/migrations/0005_populate_device.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
from django.db import migrations, models
2+
from django.db import migrations
33

44

55
def forward(apps, schema_editor):

openwisp_controller/config/migrations/0013_last_ip_management_ip_and_status_applied.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ class Migration(migrations.Migration):
5252
name='last_ip',
5353
field=models.GenericIPAddressField(
5454
blank=True,
55-
help_text='indicates the IP address logged from the last request coming from the device',
55+
help_text=(
56+
'indicates the IP address logged from the last '
57+
'request coming from the device'
58+
),
5659
null=True,
5760
),
5861
),
@@ -73,7 +76,12 @@ class Migration(migrations.Migration):
7376
field=model_utils.fields.StatusField(
7477
choices=[(0, 'dummy')],
7578
default='modified',
76-
help_text='"modified" means the configuration is not applied yet; \n"applied" means the configuration is applied successfully; \n"error" means the configuration caused issues and it was rolled back;',
79+
help_text=(
80+
'"modified" means the configuration is not applied yet; '
81+
'\n"applied" means the configuration is applied successfully; '
82+
'\n"error" means the configuration caused issues and it '
83+
'was rolled back;'
84+
),
7785
max_length=100,
7886
no_check_for_status=True,
7987
verbose_name='configuration status',

openwisp_controller/config/migrations/0018_config_context.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ class Migration(migrations.Migration):
1919
field=jsonfield.fields.JSONField(
2020
blank=True,
2121
dump_kwargs={'indent': 4},
22-
help_text='Additional <a href="http://netjsonconfig.openwisp.org/en/stable/general/basics.html#context" target="_blank">context (configuration variables)</a> in JSON format',
22+
help_text=(
23+
'Additional <a href="http://netjsonconfig.openwisp.org'
24+
'/en/stable/general/basics.html#context" target="_blank">context '
25+
'(configuration variables)</a> in JSON format'
26+
),
2327
load_kwargs={'object_pairs_hook': collections.OrderedDict},
2428
null=True,
2529
),

openwisp_controller/config/migrations/0023_update_context.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ class Migration(migrations.Migration):
2020
blank=True,
2121
default=dict,
2222
dump_kwargs={'ensure_ascii': False, 'indent': 4},
23-
help_text='Additional <a href="http://netjsonconfig.openwisp.org/en/stable/general/basics.html#context" target="_blank">context (configuration variables)</a> in JSON format',
23+
help_text=(
24+
'Additional <a href="http://netjsonconfig.openwisp.org'
25+
'/en/stable/general/basics.html#context" target="_blank">'
26+
'context (configuration variables)</a> in JSON format'
27+
),
2428
load_kwargs={'object_pairs_hook': collections.OrderedDict},
2529
),
2630
),

openwisp_controller/config/migrations/0027_add_indexes_on_ip_fields.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ class Migration(migrations.Migration):
1616
field=models.GenericIPAddressField(
1717
blank=True,
1818
db_index=True,
19-
help_text='indicates the IP address logged from the last request coming from the device',
19+
help_text=(
20+
'indicates the IP address logged from the '
21+
'last request coming from the device'
22+
),
2023
null=True,
2124
),
2225
),

openwisp_controller/config/migrations/0028_template_default_values.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ class Migration(migrations.Migration):
2020
blank=True,
2121
default=dict,
2222
dump_kwargs={'ensure_ascii': False, 'indent': 4},
23-
help_text='A dictionary containing the default values for the variables used by this template; these default variables will be used during schema validation.',
23+
help_text=(
24+
'A dictionary containing the default values for '
25+
'the variables used by this template; these default '
26+
'variables will be used during schema validation.'
27+
),
2428
load_kwargs={'object_pairs_hook': collections.OrderedDict},
2529
verbose_name='Default Values',
2630
),

openwisp_controller/config/migrations/0029_merge_django_netjsonconfig.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ class Migration(migrations.Migration):
2222
validators=[
2323
django.core.validators.RegexValidator(
2424
re.compile(
25-
'^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])(\\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9]))*$|^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$'
25+
'^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])'
26+
'(\\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]{0,61}'
27+
'[a-zA-Z0-9]))*$|^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$'
2628
),
2729
code='invalid',
2830
message='Must be either a valid hostname or mac address.',

0 commit comments

Comments
 (0)