diff options
-rw-r--r-- | service/pixelated/adapter/services/feedback_service.py | 5 | ||||
-rw-r--r-- | service/pixelated/resources/features_resource.py | 2 | ||||
-rw-r--r-- | service/test/integration/test_feedback_service.py | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/service/pixelated/adapter/services/feedback_service.py b/service/pixelated/adapter/services/feedback_service.py index 87363b12..a387df1c 100644 --- a/service/pixelated/adapter/services/feedback_service.py +++ b/service/pixelated/adapter/services/feedback_service.py @@ -1,7 +1,10 @@ +import os import requests class FeedbackService(object): + FEEDBACK_URL = os.environ.get('FEEDBACK_URL') + def __init__(self, leap_session): self.leap_session = leap_session @@ -14,4 +17,4 @@ class FeedbackService(object): "ticket[regarding_user]": account_mail } - return requests.post("https://pixelated.wazokazi.is/tickets", files=data, verify=False) + return requests.post(self.FEEDBACK_URL, files=data, verify=False) diff --git a/service/pixelated/resources/features_resource.py b/service/pixelated/resources/features_resource.py index 1c19338e..927cd9e9 100644 --- a/service/pixelated/resources/features_resource.py +++ b/service/pixelated/resources/features_resource.py @@ -29,7 +29,7 @@ class FeaturesResource(Resource): if os.environ.get('DISPATCHER_LOGOUT_URL'): dispatcher_features['logout'] = os.environ.get('DISPATCHER_LOGOUT_URL') - if os.environ.get('FEEDBACK_ENABLED') is None: + if os.environ.get('FEEDBACK_URL') is None: self.DISABLED_FEATURES.append('feedback') return respond_json( diff --git a/service/test/integration/test_feedback_service.py b/service/test/integration/test_feedback_service.py index 595a29ce..dd32374e 100644 --- a/service/test/integration/test_feedback_service.py +++ b/service/test/integration/test_feedback_service.py @@ -1,3 +1,4 @@ +import os import unittest from mockito import when from twisted.internet import defer @@ -8,6 +9,7 @@ class TestFeedbackService(unittest.TestCase, AppTestClient): @defer.inlineCallbacks def test_open_ticket(self): yield self.start_client() + self.feedback_service.FEEDBACK_URL = "https://dev.pixelated-project.org/tickets" when(self.leap_session).account_email().thenReturn("text@pixelated-project.org") response = self.feedback_service.open_ticket("Pixelated is awesome!") |