Commit 66a5f601 authored by John Red Medrano's avatar John Red Medrano

add new key cms_privilege on current user, added pusher for realtime server

parent 8c18528a
......@@ -12,14 +12,23 @@ from rest_framework import serializers
import copy
import json
import pusher
import os
import configparser
config = configparser.ConfigParser()
config_file = os.path.join('./', 'env.ini')
config.read(config_file)
REALTIMESERVER_IP = settings.REALTIMESERVER_IP
app_id = settings.app_id
key = settings.key
secret = settings.secret
cluster = settings.cluster
ssl = settings.ssl
app_id = config['SETTINGS']['app_id'],
key = config['SETTINGS']['key']
secret = config['SETTINGS']['secret']
cluster = config['SETTINGS']['cluster']
# ssl = if config['SETTINGS']['ssl'] == 1 True else
ssl = True if config['SETTINGS']['ssl'] == 1 else False
cms_notification = config['SETTINGS']['cms_notification']
def rms_websocket(my_channel, my_event, msg):
......@@ -227,13 +236,19 @@ def notification_create(form_code, message, account_no,
)
ROOM = account_no
SENDER = sender_account_no
rms_websocket(
ROOM,
SENDER,
'NEW NOTIFICATIONS'
)
# SENDER = sender_account_no
if ssl != 1:
send_broadcast_message(
ROOM,
SENDER,
'NEW NOTIFICATIONS'
)
else:
rms_websocket(
ROOM,
'NEW NOTIFICATIONS'
)
return True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment