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 ...@@ -12,14 +12,23 @@ from rest_framework import serializers
import copy import copy
import json import json
import pusher 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 REALTIMESERVER_IP = settings.REALTIMESERVER_IP
app_id = settings.app_id app_id = config['SETTINGS']['app_id'],
key = settings.key key = config['SETTINGS']['key']
secret = settings.secret secret = config['SETTINGS']['secret']
cluster = settings.cluster cluster = config['SETTINGS']['cluster']
ssl = settings.ssl # 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): def rms_websocket(my_channel, my_event, msg):
...@@ -227,13 +236,19 @@ def notification_create(form_code, message, account_no, ...@@ -227,13 +236,19 @@ def notification_create(form_code, message, account_no,
) )
ROOM = account_no ROOM = account_no
SENDER = sender_account_no # SENDER = sender_account_no
rms_websocket( if ssl != 1:
ROOM, send_broadcast_message(
SENDER, ROOM,
'NEW NOTIFICATIONS' SENDER,
) 'NEW NOTIFICATIONS'
)
else:
rms_websocket(
ROOM,
'NEW NOTIFICATIONS'
)
return True 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