summaryrefslogtreecommitdiff
path: root/service/pixelated/resources/features_resource.py
diff options
context:
space:
mode:
authorGiovane <giovaneliberato@gmail.com>2015-09-14 15:54:59 -0300
committerGiovane <giovaneliberato@gmail.com>2015-09-14 15:55:37 -0300
commitf594529222d7da7c4d825841a9c501a57ba90e40 (patch)
tree9128906974a6da969672930ef178d04f8db54e6a /service/pixelated/resources/features_resource.py
parent424f135cf1c777399ff6659b7e5ba1d1f37593ea (diff)
#442 Add feature hiddig to feedback link.
Diffstat (limited to 'service/pixelated/resources/features_resource.py')
-rw-r--r--service/pixelated/resources/features_resource.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/service/pixelated/resources/features_resource.py b/service/pixelated/resources/features_resource.py
index 6a1a49ca..0770d867 100644
--- a/service/pixelated/resources/features_resource.py
+++ b/service/pixelated/resources/features_resource.py
@@ -20,13 +20,14 @@ from twisted.web.resource import Resource
class FeaturesResource(Resource):
- DISABLED_FEATURES = ['draftReply']
-
isLeaf = True
def render_GET(self, request):
- try:
- disabled_features = {'logout': os.environ['DISPATCHER_LOGOUT_URL']}
- except KeyError:
- disabled_features = {}
- return respond_json({'disabled_features': self.DISABLED_FEATURES, 'dispatcher_features': disabled_features}, request)
+ disabled_features = ['draftReply']
+ dispatcher_features = {'logout': os.environ.get('DISPATCHER_LOGOUT_URL')}
+
+ if not os.environ.get('FEEDBACK_ENABLE'):
+ self.DISABLED_FEATURES.append('feedback')
+
+ return respond_json(
+ {'disabled_features': disabled_features, 'dispatcher_features': dispatcher_features}, request)