I'm totally befuddled with this one. I've tested this thirty ways to Sunday and it's returning False with an errorsDict and yet the action happily accepts the values and saves. Am I on crack and just not seeing something super obvious? Heck, I've even returned without checking anything and that didn't work either. I've tested and it's definitely making it into the condition to fail.
- Code: Select all
###
def closedActionConfigUi(self, valuesDict, userCancelled, typeId, actionId):
"""
Validate action form.
"""
errorsDict = indigo.Dict()
if re.match('^[\w-]+$', valuesDict["name"]) is None:
errorsDict["showAlertText"] = "Variable names must contain only alphanumeric letters or underscores."
errorsDict["name"] = "Invalid character(s)"
return (False, valuesDict, errorsDict)
return (True, valuesDict, errorsDict)