示例#1
0
文件: websockets.py 项目: webkom/lego
def notify_user_payment_error(action_type, registration, **kwargs):
    group = group_for_user(registration.user)
    kwargs["event_id"] = registration.event.id
    serializer = RegistrationPaymentReadErrorSerializer(
        {"type": action_type, "payload": registration, "meta": kwargs},
        context={"user": registration.user},
    )
    notify_group(group, serializer.data)
示例#2
0
def notify_user_payment(action_type, registration, **kwargs):
    group = group_for_user(registration.user)
    kwargs['event_id'] = registration.event.id
    serializer = RegistrationPaymentReadSocketSerializer(
        {
            'type': action_type,
            'payload': registration,
            'meta': kwargs
        },
        context={'user': registration.user})
    notify_group(group, serializer.data)
示例#3
0
def find_groups(user):
    return ["global", group_for_user(user)] + find_event_groups(user)