File tree Expand file tree Collapse file tree 3 files changed +7
-11
lines changed Expand file tree Collapse file tree 3 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -131,15 +131,19 @@ def is_https_enabled():
131
131
return bool (SSL_CERTIFICATE .get () and SSL_PRIVATE_KEY .get ())
132
132
133
133
def get_slack_client_id ():
134
+ """Returns Slack Client ID if set as environment variable else None"""
134
135
return os .environ .get ('SLACK_CLIENT_ID' )
135
136
136
137
def get_slack_client_secret ():
138
+ """Returns Slack Client Secret if set as environment variable else None"""
137
139
return os .environ .get ('SLACK_CLIENT_SECRET' )
138
140
139
141
def get_slack_verification_token ():
142
+ """Returns Slack Verification Token if set as environment variable else None"""
140
143
return os .environ .get ('SLACK_VERIFICATION_TOKEN' )
141
144
142
145
def get_slack_bot_user_token ():
146
+ """Returns Slack Bot User Token if set as environment variable else None"""
143
147
return os .environ .get ('SLACK_BOT_USER_TOKEN' )
144
148
145
149
Original file line number Diff line number Diff line change 22
22
from django .shortcuts import render
23
23
from django .http import HttpResponse
24
24
from desktop .lib .django_util import login_notrequired , JsonResponse
25
+ from desktop import conf
25
26
from django .views .decorators .csrf import csrf_exempt
26
27
27
28
from django .conf import settings
28
29
from slack_sdk import WebClient
29
30
30
31
LOG = logging .getLogger (__name__ )
31
32
32
- SLACK_VERIFICATION_TOKEN = getattr ( settings , ' SLACK_VERIFICATION_TOKEN' , None )
33
- SLACK_BOT_USER_TOKEN = getattr ( settings , ' SLACK_BOT_USER_TOKEN' , None )
33
+ SLACK_VERIFICATION_TOKEN = conf . SLACK . SLACK_VERIFICATION_TOKEN . get ( )
34
+ SLACK_BOT_USER_TOKEN = conf . SLACK . SLACK_BOT_USER_TOKEN . get ( )
34
35
35
36
36
37
slack_client = WebClient (token = SLACK_BOT_USER_TOKEN )
Original file line number Diff line number Diff line change @@ -819,12 +819,3 @@ def tracer():
819
819
except ValueError :
820
820
from desktop .monkey_patches import monkey_patch_md5
821
821
monkey_patch_md5 (MODULES_TO_PATCH )
822
-
823
- ################################################################
824
- # SLACK API Configurations
825
- ################################################################
826
-
827
- SLACK_CLIENT_ID = desktop .conf .SLACK .SLACK_CLIENT_ID .get ()
828
- SLACK_CLIENT_SECRET = desktop .conf .SLACK .SLACK_CLIENT_SECRET .get ()
829
- SLACK_VERIFICATION_TOKEN = desktop .conf .SLACK .SLACK_VERIFICATION_TOKEN .get ()
830
- SLACK_BOT_USER_TOKEN = desktop .conf .SLACK .SLACK_BOT_USER_TOKEN .get ()
You can’t perform that action at this time.
0 commit comments