summaryrefslogtreecommitdiff
path: root/service/pixelated/adapter
diff options
context:
space:
mode:
authorGiovane <giovaneliberato@gmail.com>2015-09-21 18:10:17 -0300
committerGiovane <giovaneliberato@gmail.com>2015-09-21 18:10:17 -0300
commit8d20d0fa7ed226735daba4b0507cf0037860af71 (patch)
tree0c42b44c476dd3750e196f5cec94affdff8da6ce /service/pixelated/adapter
parentb492d6928dc757e56404a1a6f0d632658c38bc13 (diff)
#442 Creates feedback service that create tickets on leap web.
Diffstat (limited to 'service/pixelated/adapter')
-rw-r--r--service/pixelated/adapter/services/feedback_service.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/service/pixelated/adapter/services/feedback_service.py b/service/pixelated/adapter/services/feedback_service.py
new file mode 100644
index 00000000..87363b12
--- /dev/null
+++ b/service/pixelated/adapter/services/feedback_service.py
@@ -0,0 +1,17 @@
+import requests
+
+
+class FeedbackService(object):
+ def __init__(self, leap_session):
+ self.leap_session = leap_session
+
+ def open_ticket(self, feedback):
+ account_mail = self.leap_session.account_email()
+ data = {
+ "ticket[comments_attributes][0][body]": feedback,
+ "ticket[subject]": "Feedback user-agent from {0}".format(account_mail),
+ "ticket[email]": account_mail,
+ "ticket[regarding_user]": account_mail
+ }
+
+ return requests.post("https://pixelated.wazokazi.is/tickets", files=data, verify=False)