mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
add color to ChangeActionChoices #12828
This commit is contained in:
committed by
Jeremy Stretch
parent
4d686e8162
commit
93175888f0
@ -210,7 +210,7 @@ class ChangeActionChoices(ChoiceSet):
|
||||
ACTION_DELETE = 'delete'
|
||||
|
||||
CHOICES = (
|
||||
(ACTION_CREATE, 'Create'),
|
||||
(ACTION_UPDATE, 'Update'),
|
||||
(ACTION_DELETE, 'Delete'),
|
||||
(ACTION_CREATE, 'Create', 'green'),
|
||||
(ACTION_UPDATE, 'Update', 'blue'),
|
||||
(ACTION_DELETE, 'Delete', 'red'),
|
||||
)
|
||||
|
@ -112,3 +112,6 @@ class StagedChange(ChangeLoggedModel):
|
||||
instance = self.model.objects.get(pk=self.object_id)
|
||||
logger.info(f'Deleting {self.model._meta.verbose_name} {instance}')
|
||||
instance.delete()
|
||||
|
||||
def get_action_color(self):
|
||||
return ChangeActionChoices.colors.get(self.action)
|
||||
|
Reference in New Issue
Block a user