Queries through the query tab do not work
CentOS 7.1
apache + mod_wsgi
puppetboard v0.1.1 installed via pip
puppetdb v3.1.0

Everything else currently works fine in puppetboard.

When I attempt to run a simply query like:

```
["=", "certname", "test"]
```

 with the "Nodes" button selected and I get the following error:
"The request sent to PuppetDB was invalid. This is usually caused by using an unsupported operator."

I've enabled debugging in the logs, and I see the following from the error_log:

```
[Thu Dec 10 15:46:57.823332 2015] [:error] [pid 27609] DEBUG:pypuppetdb.api:_query called with endpoint: environments, path: None, query: None, limit: None, offset: None, summarize_by None, count_by None, count_filter: None
[Thu Dec 10 15:46:57.823466 2015] [:error] [pid 27609] DEBUG:pypuppetdb.api:_url called with endpoint: environments and path: None
[Thu Dec 10 15:46:57.832075 2015] [:error] [pid 27609] INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): mypuppetdb.host
[Thu Dec 10 15:46:57.836359 2015] [:error] [pid 27609] DEBUG:requests.packages.urllib3.connectionpool:"GET /pdb/query/v4/environments HTTP/1.1" 200 1053
```

diff --git a/puppetboard/app.py b/puppetboard/app.py
index ec7d65f..deedfc8 100644
--- a/puppetboard/app.py
+++ b/puppetboard/app.py
@@ -15,7 +15,6 @@ from flask import (
     Response, stream_with_context, redirect,
     request
     )
-from flask_wtf.csrf import CsrfProtect
 
 from pypuppetdb import connect
 
@@ -27,7 +26,6 @@ from puppetboard.utils import (
 
 
 app = Flask(__name__)
-CsrfProtect(app)
 
 app.config.from_object('puppetboard.default_settings')
 graph_facts = app.config['GRAPH_FACTS']
@@ -727,10 +725,10 @@ def query(env):
         select field in the environment block
     :type env: :obj:`string`
     """
-    envs = environments()
-    check_env(env, envs)
-
     if app.config['ENABLE_QUERY']:
+        envs = environments()
+        check_env(env, envs)
+
         form = QueryForm()
         if form.validate_on_submit():
             if form.query.data[0] == '[':
['puppetboard/app.py']