Event Plugin likes to start on the wrong job

Hi,

I’m just setting up an event plugin that fires once a quickdraft job is complete, but it seems to want to run on tile assembly jobs as well when they finish.

We send tiled renders, which get reassembled with the DTA (which in turn has quickdraft settings added as Key-Value Pairs).

Once this DTA reassemble job has completed, the event plugin fires (and fails, as it shouldn’t be run at this stage), the QuickDraft job is then auto submitted and the event plugin fires again once this has completed (succeeding this time, as this is when it should be run)

This is the event script that tells it when to fire. I’ve tried adding lots of caveats to stop it from running on the wrong job, but no luck:

def GetDeadlineEventListener():
    return emailMonListener()


def CleanupDeadlineEventListener(eventListener):
    eventListener.Cleanup()


class emailMonListener (DeadlineEventListener):
    def __init__(self):
        self.OnJobFinishedCallback += self.OnJobFinished

def Cleanup(self):
    del self.OnJobFinishedCallback

def OnJobFinished(self, job):

    if job.JobPlugin == "DraftPlugin" and ("[Quick Draft]" in job.JobName):
        return
 

    self.LogInfo("Event Plugin: previewMon started")

Am I missing something simple here?

Thanks.