Trigger save on mapping when saving a sub-resource.
| Netbox Version | Plugin Version |
|---|---|
3.6.9 |
0.15.1 |
Actual Behavior
When the user creates/modifies/removes a sub resource ("HTTP Header" or SAML Configuration"), it will not trigger a webhook on the parent "Mapping" resource (it will trigger the webhook on the sub-resource itself though).
Desired Behavior
Whenever a sub-resource is save()'d, it should call the parent "Mapping" resource's save() method (even if no change occurred). This would automatically trigger the webhook on the parent resource.
For example:
from django.db.models.signal import post_save
from django.dispatch import receiver
@receiver(post_save, sender=HttpHeader)
def save_mapping_after_header(sender, instance: HttpHeader, **kwargs):
instance.mapping.save()