Skip to content

Commit e8df07d

Browse files
committed
Move environment variables in defaults
1 parent db460a3 commit e8df07d

File tree

4 files changed

+25
-39
lines changed

4 files changed

+25
-39
lines changed

apps/happy_birthder/defaults.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,19 @@
4141
'thesimpsonsbirthday',
4242
'tmntbirthday',
4343
]
44+
45+
GREETINGS_RESPONSE = 'Welcome to CusDeb Solutions! :tada: Emm... where was I? Oh!'
46+
47+
NOTIFY_SET_AVATAR = (
48+
'Oh, I see you didn`t set your avatar!\nPlease, do it as soon as possible. :grin:'
49+
)
50+
51+
NOTIFY_SET_BIRTH_DATE = (
52+
'Hmm…\nIt looks like you forgot to set the date of birth.\nPlease enter it (DD.MM.YYYY).'
53+
)
54+
55+
PERSONS_WITHOUT_BIRTHDAY_RESPONSE = 'These persons did not provide date of birth.'
56+
57+
PERSONS_WITHOUT_AVATAR_RESPONSE = 'These users didn`t set their avatars.'
58+
59+
SET_BIRTHDAY_RESPONSE = 'I memorized you birthday, well done! :wink:'

apps/happy_birthder/settings.py

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Settings for HappyBirthder application. """
2+
23
import os
34

45
from apps.happy_birthder.defaults import * # pylint: disable=wildcard-import,unused-wildcard-import
@@ -16,6 +17,7 @@
1617

1718
PG_USER = os.environ['PG_USER']
1819

20+
1921
# HappyBirthder
2022
BIRTHDAY_CHANNEL_TTL = int(os.getenv('BIRTHDAY_CHANNEL_TTL', '3'))
2123

@@ -25,44 +27,10 @@
2527

2628
CREATE_BIRTHDAY_CHANNELS = os.getenv('CREATE_BIRTHDAY_CHANNELS', '').lower() == 'true'
2729

28-
COMPANY_NAME = os.environ['COMPANY_NAME']
29-
30-
GREETINGS_RESPONSE = os.getenv(
31-
'GREETINGS_RESPONSE',
32-
f'Welcome to {COMPANY_NAME}!'
33-
)
34-
35-
NOTIFY_SET_AVATAR = os.getenv(
36-
'NOTIFY_SET_AVATAR',
37-
"Oh, I see you didn't set your avatar!\nPlease, do it as soon as possible. :grin:",
38-
)
39-
40-
NOTIFY_SET_BIRTH_DATE = os.getenv(
41-
'NOTIFY_SET_BIRTH_DATE',
42-
'Hmm…\nIt looks like you forgot to set the date of birth.'
43-
'\nPlease enter it (DD.MM.YYYY).'
44-
)
45-
4630
NUMBER_OF_DAYS_IN_ADVANCE = int(os.getenv('NUMBER_OF_DAYS_IN_ADVANCE', '7'))
4731

48-
PERSONS_WITHOUT_BIRTHDAY_RESPONSE = os.getenv('PERSONS_WITHOUT_BIRTHDAY_RESPONSE',
49-
'These persons did not provide date of birth.')
50-
51-
PERSONS_WITHOUT_AVATAR_RESPONSE = os.getenv(
52-
'PERSONS_WITHOUT_AVATAR_RESPONSE',
53-
"These users didn't set their avatars.",
54-
)
55-
56-
SET_BIRTHDAY_RESPONSE = os.getenv(
57-
'SET_BIRTHDAY_RESPONSE',
58-
'I memorized you birthday, well done! :wink:'
59-
)
6032

6133
# TenorAPI
62-
_CONGRATULATION_PHRASES = os.getenv('CONGRATULATION_PHRASES')
63-
CONGRATULATION_PHRASES = (_CONGRATULATION_PHRASES.split(',') if _CONGRATULATION_PHRASES
64-
else CONGRATULATION_PHRASES)
65-
6634
TENOR_API_KEY = os.environ['TENOR_API_KEY']
6735

6836
TENOR_API_URL = os.getenv('TENOR_API_URL', 'https://api.tenor.com/v1/')
@@ -72,10 +40,10 @@
7240
_TENOR_SEARCH_TERM = os.getenv('TENOR_SEARCH_TERM')
7341
TENOR_SEARCH_TERM = (_TENOR_SEARCH_TERM.split(',') if _TENOR_SEARCH_TERM else TENOR_SEARCH_TERM)
7442

75-
7643
_TENOR_BLACKLISTED_GIF_IDS = os.getenv('TENOR_BLACKLISTED_GIF_IDS')
7744
TENOR_BLACKLISTED_GIF_IDS = (_TENOR_BLACKLISTED_GIF_IDS.split(',')
7845
if _TENOR_BLACKLISTED_GIF_IDS else [])
7946

47+
8048
# Scheduler
8149
HB_CRONTAB = os.getenv('HB_CRONTAB', '0 0 7 * * *')

meeseeks/defaults.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,14 @@
88
'apps.VoteOrDie',
99
)
1010

11+
HELLO_RESPONSE = 'Hello world!'
12+
1113
RC_REALTIME_LOGIN = 'login'
1214

15+
TIME_ZONE = 'Europe/Moscow'
16+
17+
18+
# Rocket.Chat API endpoints
1319
CHAT_MESSAGE_POST_REQUEST = '/chat.postMessage/'
1420

1521
CHAT_REACT_POST_REQUEST = '/chat.react/'

meeseeks/settings.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,3 @@
1818
USER_NAME = os.environ['USER_NAME']
1919

2020
CONNECT_ATTEMPTS = int(os.getenv('CONNECT_ATTEMPTS', '5'))
21-
22-
HELLO_RESPONSE = os.getenv('HELLO_RESPONSE', 'Hello my friend')
23-
24-
TIME_ZONE = os.getenv('TIME_ZONE', 'Europe/Moscow')

0 commit comments

Comments
 (0)