diff options
author | Giovane <giovaneliberato@gmail.com> | 2015-09-21 18:10:17 -0300 |
---|---|---|
committer | Giovane <giovaneliberato@gmail.com> | 2015-09-21 18:10:17 -0300 |
commit | 8d20d0fa7ed226735daba4b0507cf0037860af71 (patch) | |
tree | 0c42b44c476dd3750e196f5cec94affdff8da6ce /service/pixelated/adapter | |
parent | b492d6928dc757e56404a1a6f0d632658c38bc13 (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.py | 17 |
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) |