Merge pull request #7758 from thuck/template_self_reference_7614

Validate query to avoid self-reference of variable #7614
This commit is contained in:
Daniel Lee 2017-03-20 15:33:48 +01:00 committed by GitHub
commit e527aebbf1

View File

@ -77,6 +77,11 @@ export class VariableEditorCtrl {
return false;
}
if ($scope.current.type === 'query' && $scope.current.query.match(new RegExp('\\$' + $scope.current.name))) {
$scope.appEvent('alert-warning', ['Validation', 'Query contains variable self-reference']);
return false;
}
return true;
};