From ec46044d181128daf59d4a3e860276139f188cba Mon Sep 17 00:00:00 2001 From: LHBL2003 <46369917+LHBL2003@users.noreply.github.com> Date: Thu, 23 May 2024 17:30:18 +0200 Subject: [PATCH] Update data-validation.md Revised after suggestion by jeremystretch --- docs/configuration/data-validation.md | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/docs/configuration/data-validation.md b/docs/configuration/data-validation.md index bdf4f3a94..af99a6070 100644 --- a/docs/configuration/data-validation.md +++ b/docs/configuration/data-validation.md @@ -96,7 +96,7 @@ The following colors are supported: This is a mapping of models to [custom validators](../customization/custom-validation.md) against which an object is evaluated immediately prior to its deletion. If validation fails, the object is not deleted. An example is provided below: -**Example prevents the deletion of a site entry:** +Example prevents the deletion of a site entry: ```python PROTECTION_RULES = { "dcim.site": [ @@ -111,14 +111,9 @@ PROTECTION_RULES = { ``` ### Configuration via Web UI +Example prevents the deletion of a device entry: ![image](https://github.com/netbox-community/netbox/assets/46369917/6fb69ab8-1f13-4b86-b84c-ce697af8f679) - -**Path:** -- WebUI (v3.x.x) --> Admin --> Configuration Config Revisions --> Add (or Edit last Config) -- WebUI (v4.0.0) --> Admin --> Configuration History --> Add (or Edit last Config) - -**Example prevents the deletion of a device entry:** ```python { "dcim.device": [ @@ -131,7 +126,7 @@ PROTECTION_RULES = { } ``` -If you navigate to a device, rack or site, you will find the path in the top right-hand corner. +If you navigate to a device, rack or site, you will find the path in the top right-hand corner: ![image](https://github.com/netbox-community/netbox/assets/46369917/3f1c8f12-0714-4590-99d7-41ef5da7c1c3) @@ -139,4 +134,3 @@ Examples: - dcim.device - dcim.site - dcim.rack -```