V1.30.12 initialize_app fix
This commit is contained in:
parent
1a7ce950c8
commit
e19e830b4b
@ -1,4 +1,5 @@
|
||||
import os
|
||||
from firebase_admin import initialize_app
|
||||
|
||||
BACKOFFICE_VERSION = "1.30"
|
||||
|
||||
@ -17,6 +18,9 @@ DEBUG = False
|
||||
|
||||
ALLOWED_HOSTS = ['62.171.188.119', "admin.aitrainer.app"]
|
||||
|
||||
env = os.environ['GOOGLE_APPLICATION_CREDENTIALS']
|
||||
FIREBASE_APP = initialize_app()
|
||||
|
||||
INSTALLED_APPS = [
|
||||
'aitrainer_backoffice',
|
||||
'controlling.apps.ControllingConfig',
|
||||
|
@ -15,6 +15,9 @@ ALLOWED_HOSTS = ['localhost', "127.0.0.1"]
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = True
|
||||
|
||||
env = os.environ['GOOGLE_APPLICATION_CREDENTIALS']
|
||||
FIREBASE_APP = initialize_app()
|
||||
|
||||
INSTALLED_APPS = [
|
||||
'aitrainer_backoffice',
|
||||
'controlling.apps.ControllingConfig',
|
||||
|
@ -1,4 +1,5 @@
|
||||
import os
|
||||
from firebase_admin import initialize_app
|
||||
|
||||
BACKOFFICE_VERSION = "1.30"
|
||||
|
||||
@ -15,6 +16,9 @@ DEBUG = False
|
||||
|
||||
ALLOWED_HOSTS = ['62.171.188.119', "admin.aitrainer.app"]
|
||||
|
||||
env = os.environ['GOOGLE_APPLICATION_CREDENTIALS']
|
||||
FIREBASE_APP = initialize_app()
|
||||
|
||||
INSTALLED_APPS = [
|
||||
'aitrainer_backoffice.aitrainer_backoffice',
|
||||
'aitrainer_backoffice.controlling.apps.ControllingConfigLive',
|
||||
|
@ -1,6 +1,6 @@
|
||||
import datetime
|
||||
import os
|
||||
from firebase_admin import messaging, initialize_app, exceptions
|
||||
from firebase_admin import messaging, exceptions
|
||||
|
||||
class FCM:
|
||||
logo_url = 'https://workouttest.com/wp-content/uploads/2020/10/WT_long_logo.png'
|
||||
@ -9,8 +9,7 @@ class FCM:
|
||||
def __init__(self):
|
||||
# To learn more, visit the docs here:
|
||||
# https://cloud.google.com/docs/authentication/getting-started>
|
||||
env = os.environ['GOOGLE_APPLICATION_CREDENTIALS']
|
||||
default_app = initialize_app()
|
||||
pass
|
||||
|
||||
def send_to_multiple_token(self, title, body, registration_token, image_url = None):
|
||||
try:
|
||||
|
@ -14,8 +14,9 @@ import traceback
|
||||
|
||||
class Notification:
|
||||
fcm = None
|
||||
def __init__(self) -> None:
|
||||
self.fcm = FCM()
|
||||
def __init__(self) -> None:
|
||||
if self.fcm == None:
|
||||
self.fcm = FCM()
|
||||
|
||||
def run(self):
|
||||
print("** Running Notification automation")
|
||||
@ -56,3 +57,4 @@ class Notification:
|
||||
history.notification_date = datetime.datetime.now(tz=cet)
|
||||
history.save()
|
||||
print(f'-- Notification History "{history}" has been saved')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user