Skip to content

Commit

Permalink
fix: [AXM-334] Fix firebase credentials getting logic
Browse files Browse the repository at this point in the history
  • Loading branch information
KyryloKireiev committed Jun 11, 2024
1 parent 85440e6 commit 7278c29
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion openedx/core/djangoapps/ace_common/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,18 @@ def plugin_settings(settings): # lint-amnesty, pylint: disable=missing-function
# Note: To local development with Firebase, you must set FIREBASE_CREDENTIALS_PATH
# (path to json file with FIREBASE_CREDENTIALS)
# or FIREBASE_CREDENTIALS dictionary.
# AND COMMENT or remove `settings.FIREBASE_APP = None` string below.
settings.FIREBASE_CREDENTIALS_PATH = None
settings.FIREBASE_CREDENTIALS = None
settings.FIREBASE_APP = None

settings.FCM_APP_NAME = 'fcm-edx-platform'
used_firebase_credentials = getattr(settings, 'FIREBASE_CREDENTIALS_PATH', None)
if not used_firebase_credentials:
used_firebase_credentials = getattr(settings, 'FIREBASE_CREDENTIALS', None)

if used_firebase_credentials:
settings.FIREBASE_APP = setup_firebase_app(settings.FIREBASE_CREDENTIALS, settings.FCM_APP_NAME)
settings.FIREBASE_APP = setup_firebase_app(used_firebase_credentials, settings.FCM_APP_NAME)

if getattr(settings, 'FIREBASE_APP', None):
settings.ACE_ENABLED_CHANNELS.append(settings.ACE_CHANNEL_DEFAULT_PUSH)
Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/ace_common/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def plugin_settings(settings):
used_firebase_credentials = settings.FIREBASE_CREDENTIALS

if used_firebase_credentials:
settings.FIREBASE_APP = setup_firebase_app(settings.FIREBASE_CREDENTIALS, settings.FCM_APP_NAME)
settings.FIREBASE_APP = setup_firebase_app(used_firebase_credentials, settings.FCM_APP_NAME)

if settings.FIREBASE_APP:
settings.ACE_ENABLED_CHANNELS.append(settings.ACE_CHANNEL_DEFAULT_PUSH)
Expand Down

0 comments on commit 7278c29

Please sign in to comment.