fix the other side of that race condition
fix the other side of that race condition

If automation_set was set before it was created in the database, we will
throw an exception when trying to disable automation.

wuvt/wuvt-site,wuvt/wuvt-site,wuvt/wuvt-site,wuvt/wuvt-site