title: Can we disable a route in python flask?
body: <p>I have a situation like this,</p>
  
  <pre><code>@app.route("/test")
  def test():
      data = getdata
      return render_template("test.html", data=data)
  
  @app.route("/test2")
  def test2():
      data = getdatainfo
      return render_template("test2.html", data=data)
  </code></pre>
  
  <p>test route returns data like this:</p>
  
  <pre><code>data = [{ id:1, name:'a'}, {id:2, name:'b'}]
  </code></pre>
  
  <p>if the test route data length is equal to 2 I have to disable the route  "test2" route how can I do that.</p>