Skip to content

Webhooks fire erroneously when custom scripts fail causing a transaction rolback #9466

@kkthxbye-code

Description

@kkthxbye-code

NetBox version

v3.2.4

Python version

3.9

Steps to Reproduce

  • Register a webhook handler for the Contact object type.
  • Run the following custom script:
from extras.scripts import Script
from tanancy.models import Contact

class MyScript(Script):
    def run(self, data, commit):
        contact = Contact(name="test")
        contact.full_clean()
        contact.save()
        raise Exception("Exception")

Expected Behavior

No webhooks are sent as the script failed and the database transaction is rolled back.

Observed Behavior

A weebhook is fired for the contact object.

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions