-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add send activation email checks (#386)
- Loading branch information
Showing
4 changed files
with
49 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# -*- coding: utf-8 -*- | ||
from django.conf import settings | ||
|
||
DB_NAME = settings.DATABASES.get("default", {}).get("NAME", "") | ||
DB_ENGINE = settings.DATABASES.get("default", {}).get("ENGINE", "") | ||
|
||
|
||
def is_remote(): | ||
"""Check if it is remote environment""" | ||
return "prod" in settings.SETTINGS_MODULE | ||
|
||
|
||
def is_dev(): | ||
"""Check if it is remote development environment""" | ||
if is_remote() and "dev" in DB_NAME: | ||
return True | ||
return False | ||
|
||
|
||
def is_stag(): | ||
"""Check if it is remote staging environment""" | ||
if is_remote() and "stag" in DB_NAME: | ||
return True | ||
return False | ||
|
||
|
||
def is_prod(): | ||
"""Check if it is remote production environment""" | ||
if is_remote() and not is_dev() and not is_stag(): | ||
return True | ||
return False |