Skip to content

Commit 4dd229e

Browse files
committed
Fixes #13864: Remove 'default' choice for dashboard widget color
1 parent db40119 commit 4dd229e

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

netbox/extras/choices.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,3 +244,39 @@ class ChangeActionChoices(ChoiceSet):
244244
(ACTION_UPDATE, _('Update'), 'blue'),
245245
(ACTION_DELETE, _('Delete'), 'red'),
246246
)
247+
248+
249+
#
250+
# Dashboard widgets
251+
#
252+
253+
class DashboardWidgetColorChoices(ChoiceSet):
254+
BLUE = 'blue'
255+
INDIGO = 'indigo'
256+
PURPLE = 'purple'
257+
PINK = 'pink'
258+
RED = 'red'
259+
ORANGE = 'orange'
260+
YELLOW = 'yellow'
261+
GREEN = 'green'
262+
TEAL = 'teal'
263+
CYAN = 'cyan'
264+
GRAY = 'gray'
265+
BLACK = 'black'
266+
WHITE = 'white'
267+
268+
CHOICES = (
269+
(BLUE, _('Blue')),
270+
(INDIGO, _('Indigo')),
271+
(PURPLE, _('Purple')),
272+
(PINK, _('Pink')),
273+
(RED, _('Red')),
274+
(ORANGE, _('Orange')),
275+
(YELLOW, _('Yellow')),
276+
(GREEN, _('Green')),
277+
(TEAL, _('Teal')),
278+
(CYAN, _('Cyan')),
279+
(GRAY, _('Gray')),
280+
(BLACK, _('Black')),
281+
(WHITE, _('White')),
282+
)

netbox/extras/dashboard/forms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
from django.urls import reverse_lazy
33
from django.utils.translation import gettext as _
44

5+
from extras.choices import DashboardWidgetColorChoices
56
from netbox.registry import registry
67
from utilities.forms import BootstrapMixin, add_blank_choice
7-
from utilities.choices import ButtonColorChoices
88

99
__all__ = (
1010
'DashboardWidgetAddForm',
@@ -21,7 +21,7 @@ class DashboardWidgetForm(BootstrapMixin, forms.Form):
2121
required=False
2222
)
2323
color = forms.ChoiceField(
24-
choices=add_blank_choice(ButtonColorChoices),
24+
choices=add_blank_choice(DashboardWidgetColorChoices),
2525
required=False,
2626
)
2727

0 commit comments

Comments
 (0)