We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 671ca54 commit ec631f2Copy full SHA for ec631f2
project/config/settings/common.py
@@ -271,6 +271,7 @@
271
HOLVI_APIKEY = env('HOLVI_APIKEY', default=None)
272
HOLVI_BARCODE_IBAN = env('HOLVI_BARCODE_IBAN', default=None)
273
HOLVI_NOTIFICATION_INTERVAL_DAYS = env('HOLVI_NOTIFICATION_INTERVAL_DAYS', default=7)
274
+SLACK_APIKEY = env('SLACK_APIKEY', default=None)
275
276
REST_FRAMEWORK = {
277
'DEFAULT_AUTHENTICATION_CLASSES': [
project/slacksync/utils.py
@@ -0,0 +1,11 @@
1
+from django.conf import settings
2
+from slacker import Slacker
3
+
4
5
+def api_configured():
6
+ return bool(settings.SLACK_APIKEY)
7
8
+def get_client(**kwargs):
9
+ if not api_configured():
10
+ return False
11
+ return Slacker(settings.SLACK_APIKEY, **kwargs)
0 commit comments