diff options
author | mnandri <mnandri@eumguccion.corporate.thoughtworks.com> | 2015-12-15 18:05:43 +0100 |
---|---|---|
committer | mnandri <mnandri@eunglick.corporate.thoughtworks.com> | 2015-12-18 11:22:34 +0100 |
commit | f8ac23150f5f840eaa4ef920b003966f911de8fa (patch) | |
tree | bf8179d942a0f0e7cc5017a243dded302212b9ed /service/pixelated/resources | |
parent | 93350f99193b78c6adf0b79b8565fe477912fd80 (diff) |
enabling backend for Attachment feature toggle
Issue #548
Diffstat (limited to 'service/pixelated/resources')
-rw-r--r-- | service/pixelated/resources/features_resource.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/service/pixelated/resources/features_resource.py b/service/pixelated/resources/features_resource.py index 927cd9e9..2c1d5b1b 100644 --- a/service/pixelated/resources/features_resource.py +++ b/service/pixelated/resources/features_resource.py @@ -20,7 +20,6 @@ from twisted.web.resource import Resource class FeaturesResource(Resource): - DISABLED_FEATURES = ['draftReply'] isLeaf = True def render_GET(self, request): @@ -29,8 +28,14 @@ class FeaturesResource(Resource): if os.environ.get('DISPATCHER_LOGOUT_URL'): dispatcher_features['logout'] = os.environ.get('DISPATCHER_LOGOUT_URL') - if os.environ.get('FEEDBACK_URL') is None: - self.DISABLED_FEATURES.append('feedback') - + disabled_features = self._disabled_features() return respond_json( - {'disabled_features': self.DISABLED_FEATURES, 'dispatcher_features': dispatcher_features}, request) + {'disabled_features': disabled_features, 'dispatcher_features': dispatcher_features}, request) + + def _disabled_features(self): + disabled_features = ['draftReply'] + if os.environ.get('FEEDBACK_URL') is None: + disabled_features.append('feedback') + if 'ATTACHMENT' not in os.environ: + disabled_features.append('attachment') + return disabled_features |