forked from GithubBackups/healthchecks
Use Slack V2 OAuth flow
This commit is contained in:
parent
9d2cf4f008
commit
56bb49f1f3
@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
### Improvements
|
||||
- Rate limiting for Telegram notifications (10 notifications per chat per minute)
|
||||
- Use Slack V2 OAuth flow
|
||||
|
||||
### Bug Fixes
|
||||
- "Get a single check" API call now supports read-only API keys (#346)
|
||||
|
@ -528,7 +528,11 @@ class Channel(models.Model):
|
||||
return None
|
||||
|
||||
doc = json.loads(self.value)
|
||||
return doc["team_name"]
|
||||
if "team_name" in doc:
|
||||
return doc["team_name"]
|
||||
|
||||
if "team" in doc:
|
||||
return doc["team"]["name"]
|
||||
|
||||
@property
|
||||
def slack_channel(self):
|
||||
|
@ -1037,7 +1037,7 @@ def add_slack_btn(request, code):
|
||||
project = _get_project_for_user(request, code)
|
||||
|
||||
state = token_urlsafe()
|
||||
authorize_url = "https://slack.com/oauth/authorize?" + urlencode(
|
||||
authorize_url = "https://slack.com/oauth/v2/authorize?" + urlencode(
|
||||
{
|
||||
"scope": "incoming-webhook",
|
||||
"client_id": settings.SLACK_CLIENT_ID,
|
||||
@ -1071,7 +1071,7 @@ def add_slack_complete(request):
|
||||
return HttpResponseForbidden()
|
||||
|
||||
result = requests.post(
|
||||
"https://slack.com/api/oauth.access",
|
||||
"https://slack.com/api/oauth.v2.access",
|
||||
{
|
||||
"client_id": settings.SLACK_CLIENT_ID,
|
||||
"client_secret": settings.SLACK_CLIENT_SECRET,
|
||||
|
Loading…
x
Reference in New Issue
Block a user