From a12e9e687ef5564609c19a91a9b7ebf64f1bfd77 Mon Sep 17 00:00:00 2001 From: anshengme Date: Thu, 9 May 2019 00:51:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=87=B30.0.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup.py | 2 +- src/sentry_dingding/__init__.py | 2 +- src/sentry_dingding/plugin.py | 11 +++++------ 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/setup.py b/setup.py index eff30a7..aa7501f 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name="sentry-dingding", - version='0.0.2', + version='0.0.3', author='ansheng', author_email='ianshengme@gmail.com', url='https://github.com/anshengme/sentry-dingding', diff --git a/src/sentry_dingding/__init__.py b/src/sentry_dingding/__init__.py index 49a23db..78e95d8 100644 --- a/src/sentry_dingding/__init__.py +++ b/src/sentry_dingding/__init__.py @@ -1,3 +1,3 @@ # coding: utf-8 -VERSION = "0.0.2" +VERSION = "0.0.3" diff --git a/src/sentry_dingding/plugin.py b/src/sentry_dingding/plugin.py index c938169..029f85b 100644 --- a/src/sentry_dingding/plugin.py +++ b/src/sentry_dingding/plugin.py @@ -37,10 +37,10 @@ def is_configured(self, project): """ return bool(self.get_option('access_token', project)) - def notify_users(self, group, event, fail_silently=False): - self.post_process(group, event, fail_silently=fail_silently) + def notify_users(self, group, event, *args, **kwargs): + self.post_process(group, event, *args, **kwargs) - def post_process(self, group, event, **kwargs): + def post_process(self, group, event, *args, **kwargs): """ Process error. """ @@ -48,9 +48,8 @@ def post_process(self, group, event, **kwargs): return access_token = self.get_option('access_token', group.project) - send_url = DingTalk_API.format(token=access_token) - title = "New alert from {}".format(event.project.name) + title = "New alert from {}".format(event.project.slug) data = { "msgtype": "markdown", @@ -59,7 +58,7 @@ def post_process(self, group, event, **kwargs): "text": u"#### {title} \n > {message} [href]({url})".format( title=title, message=event.message, - url=u"{0}events/{1}/".format(group.get_absolute_url(), event.id) + url=u"{}events/{}/".format(group.get_absolute_url(), event.id), ) } }