Explorar el Código

Merge branch 'master' of github.com:grafana/grafana

Torkel Ödegaard hace 8 años
padre
commit
c1c241698a
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      public/app/features/templating/editor_ctrl.ts

+ 5 - 0
public/app/features/templating/editor_ctrl.ts

@@ -77,6 +77,11 @@ export class VariableEditorCtrl {
         return false;
         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;
       return true;
     };
     };