#16886: Misc cleanup

This commit is contained in:
Jeremy Stretch 2024-07-31 16:02:20 -04:00
parent 6e59db7310
commit a49a74236b
3 changed files with 5 additions and 9 deletions

View File

@ -7,6 +7,7 @@
* Several filters deprecated in v4.0 have been removed (see [#15410](https://github.com/netbox-community/netbox/issues/15410)). * Several filters deprecated in v4.0 have been removed (see [#15410](https://github.com/netbox-community/netbox/issues/15410)).
* The unit size for virtual disk size has been changed from 1 gigabyte to 1 megabyte. Existing values have been updated accordingly. * The unit size for virtual disk size has been changed from 1 gigabyte to 1 megabyte. Existing values have been updated accordingly.
* The `min_vid` and `max_vid` fields on the VLAN group model have been replaced with `vid_ranges`, an array of starting and ending integer pairs. * The `min_vid` and `max_vid` fields on the VLAN group model have been replaced with `vid_ranges`, an array of starting and ending integer pairs.
* The five individual event type fields on the EventRule model have been replaced by a single `event_types` array field, indicating each assigned event type by name.
* The `validate()` method on CustomValidator subclasses now **must** accept the request argument (deprecated in v4.0 by #14279). * The `validate()` method on CustomValidator subclasses now **must** accept the request argument (deprecated in v4.0 by #14279).
### New Features ### New Features
@ -72,6 +73,9 @@ NetBox now includes a user notification system. Users can subscribe to individua
* Added the optional `airflow` choice field * Added the optional `airflow` choice field
* extras.CustomField * extras.CustomField
* Added the `related_object_filter` JSON field for object and multi-object custom fields * Added the `related_object_filter` JSON field for object and multi-object custom fields
* extras.EventRule
* Removed the `type_create`, `type_update`, `type_delete`, `type_job_start`, and `type_job_end` boolean fields
* Added the `event_types` array field
* ipam.VLANGroup * ipam.VLANGroup
* Removed the `min_vid` and `max_vid` fields * Removed the `min_vid` and `max_vid` fields
* Added the `vid_ranges` field, and array of starting & ending VLAN IDs * Added the `vid_ranges` field, and array of starting & ending VLAN IDs

View File

@ -551,14 +551,6 @@ class EventRuleListView(generic.ObjectListView):
class EventRuleView(generic.ObjectView): class EventRuleView(generic.ObjectView):
queryset = EventRule.objects.all() queryset = EventRule.objects.all()
def get_extra_context(self, request, instance):
return {
'event_types': [
event for name, event in registry['event_types'].items()
if name in instance.event_types
]
}
@register_model_view(EventRule, 'edit') @register_model_view(EventRule, 'edit')
class EventRuleEditView(generic.ObjectEditView): class EventRuleEditView(generic.ObjectEditView):

View File

@ -36,7 +36,7 @@
<div class="card"> <div class="card">
<h5 class="card-header">{% trans "Event Types" %}</h5> <h5 class="card-header">{% trans "Event Types" %}</h5>
<ul class="list-group list-group-flush"> <ul class="list-group list-group-flush">
{% for name, event in registry.events.items %} {% for name, event in registry.event_types.items %}
<li class="list-group-item"> <li class="list-group-item">
<div class="row align-items-center"> <div class="row align-items-center">
<div class="col-auto"> <div class="col-auto">