Skip to content

Commit 88a3fc7

Browse files
pandafynemesifier
authored andcommitted
[chores] Use settings to show choices in model fields
Signed-off-by: Gagan Deep <[email protected]>
1 parent 35f99f5 commit 88a3fc7

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

openwisp_controller/config/migrations/0001_squashed_0002_config_settings_uuid.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,7 @@ class Migration(migrations.Migration):
4646
(
4747
'backend',
4848
models.CharField(
49-
choices=[
50-
('netjsonconfig.OpenWrt', 'OpenWRT'),
51-
('netjsonconfig.OpenWisp', 'OpenWISP Firmware 1.x'),
52-
],
49+
choices=app_settings.BACKENDS,
5350
help_text=(
5451
'Select <a href="http://netjsonconfig.openwisp.org'
5552
'/en/stable/" target="_blank">netjsonconfig</a> '
@@ -242,10 +239,7 @@ class Migration(migrations.Migration):
242239
(
243240
'backend',
244241
models.CharField(
245-
choices=[
246-
('netjsonconfig.OpenWrt', 'OpenWRT'),
247-
('netjsonconfig.OpenWisp', 'OpenWISP Firmware 1.x'),
248-
],
242+
choices=app_settings.BACKENDS,
249243
help_text=(
250244
'Select <a href="http://netjsonconfig.openwisp.org'
251245
'/en/stable/" target="_blank">netjsonconfig</a> backend'

tests/openwisp2/sample_config/migrations/0001_initial.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,7 @@ class Migration(migrations.Migration):
6464
(
6565
'backend',
6666
models.CharField(
67-
choices=[
68-
('netjsonconfig.OpenWrt', 'OpenWRT'),
69-
('netjsonconfig.OpenWisp', 'OpenWISP Firmware 1.x'),
70-
],
67+
choices=app_settings.BACKENDS,
7168
help_text=(
7269
'Select <a href="http://netjsonconfig.openwisp.org/en/'
7370
'stable/" target="_blank">netjsonconfig</a> backend'
@@ -491,10 +488,7 @@ class Migration(migrations.Migration):
491488
(
492489
'backend',
493490
models.CharField(
494-
choices=[
495-
('netjsonconfig.OpenWrt', 'OpenWRT'),
496-
('netjsonconfig.OpenWisp', 'OpenWISP Firmware 1.x'),
497-
],
491+
choices=app_settings.BACKENDS,
498492
help_text=(
499493
'Select <a href="http://netjsonconfig.openwisp.org/en/'
500494
'stable/" target="_blank">netjsonconfig</a> backend'

0 commit comments

Comments
 (0)