Skip to content

Conversation

@jeremystretch
Copy link
Member

@jeremystretch jeremystretch commented Dec 13, 2023

Fixes: #12731

  • Override _post_clean() on NetBoxModelForm to store M2M field values on the cleaned instance for reference
  • Extend BulkEditVIew to store M2M fields for validation
  • Extend validate() on ValidatedModelSerializer similar to what we did for forms
  • Introduce a _getattr() method on CustomValidator to reference the _m2m_values instance attribute when evaluating rules which reference many-to-many fields
  • Add tests for custom validation of M2M fields for model forms and serializers

@jeremystretch jeremystretch marked this pull request as ready for review December 21, 2023 20:08
@jeremystretch jeremystretch merged commit 99467e8 into develop Dec 22, 2023
@jeremystretch jeremystretch deleted the 12731-m2m-validation branch December 22, 2023 15:01
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom validators unable to validate tag presence

2 participants