V1.30.11 models simplification
This commit is contained in:
@@ -10,7 +10,6 @@ class FCM:
|
||||
# To learn more, visit the docs here:
|
||||
# https://cloud.google.com/docs/authentication/getting-started>
|
||||
env = os.environ['GOOGLE_APPLICATION_CREDENTIALS']
|
||||
print(f'ENV: {env}')
|
||||
default_app = initialize_app()
|
||||
|
||||
def send_to_multiple_token(self, title, body, registration_token, image_url = None):
|
||||
|
||||
@@ -1,20 +1,25 @@
|
||||
import os
|
||||
import datetime
|
||||
import pytz
|
||||
from .notification_hook import NotificationHook
|
||||
|
||||
from aitrainer_backoffice.aitrainer_backoffice.models import notification as notif
|
||||
SETTING = os.environ['WORKOUTTEST_SETTING']
|
||||
if SETTING == "PROD":
|
||||
from aitrainer_backoffice.aitrainer_backoffice.models.notification import NotificationHistory, Notification
|
||||
else:
|
||||
from aitrainer_backoffice.models.notification import NotificationHistory, Notification
|
||||
|
||||
|
||||
from ..models.notification import NotificationHistory
|
||||
from .fcm import FCM
|
||||
import traceback
|
||||
|
||||
class Notification:
|
||||
fcm = FCM()
|
||||
fcm = None
|
||||
def __init__(self) -> None:
|
||||
self.fcm = FCM()
|
||||
|
||||
def run(self):
|
||||
print("** Running Notification automation")
|
||||
notification_queryset = notif.Notification.objects.using('live').raw('SELECT * from notification WHERE active = 1')
|
||||
notification_queryset = Notification.objects.using('live').raw('SELECT * from notification WHERE active = 1')
|
||||
|
||||
for notification in notification_queryset:
|
||||
if notification.schedule_date != None:
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
from ..models.customer import Customer
|
||||
import datetime
|
||||
import os
|
||||
|
||||
SETTING = os.environ['WORKOUTTEST_SETTING']
|
||||
if SETTING == "PROD":
|
||||
from aitrainer_backoffice.aitrainer_backoffice.models.customer import Customer
|
||||
else:
|
||||
from aitrainer_backoffice.models.customer import Customer
|
||||
|
||||
class NotificationHook:
|
||||
def __init__(self) -> None:
|
||||
|
||||
Reference in New Issue
Block a user