7.2.0
Release 7.2.0
What's Changed:
- Add model validation on save by @Omripresent in PR #82
- 📝 Add docstrings to
model_validation_on_save
by @coderabbitai in PR #83 - Add model validation on save by @Kani999 in PR #84
New Contributors:
- @Omripresent made their first contribution in PR #82
- @coderabbitai made their first contribution in PR #83
Enhancements:
- Introduced model-level validation to ensure attachments are only created for permitted object types. Attempting to attach to an unpermitted model will raise a
ValidationError
. - Added a new validation function
validate_object_type
used across forms and models to enforce attachment permissions. - Updated the README with a new badge and additional documentation for the validation checks.
Technical Changes:
- Forms:
- Added
_validate_object_type
method to theNetBoxAttachmentForm
to validate object types during form cleaning.
- Added
- Models:
- Enhanced
NetBoxAttachment
model with validation logic in thesave
method to ensure only permitted models can have attachments. - Improved deletion method to preserve original filenames post-deletion.
- Enhanced
- Utilities:
- Added
validate_object_type
function to determine eligible models for attachments based on plugin settings. - Added
choice_default
utility function to handle default values for settings.
- Added
- Template Content:
- Updated to use the new
validate_object_type
function to dynamically generate template extensions for eligible models.
- Updated to use the new
Full Changelog: 7.1.0...7.2.0
This release introduces significant validation improvements to ensure that attachments are only created for permitted models, enhancing the overall security and integrity of the plugin.