Пример #1
0
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_event_updated(event, **kwargs):
    group = group_for_event(event)
    serializer = EventReadDetailedSocketSerializer({
        "type": "SOCKET_EVENT_UPDATED",
        "payload": event,
        "meta": kwargs
    })

    notify_group(group, serializer.data)
Пример #3
0
def notify_event_registration(action_type, registration, **kwargs):
    group = group_for_event(registration.event)
    kwargs["event_id"] = registration.event.id
    serializer = RegistrationReadSocketSerializer({
        "type": action_type,
        "payload": registration,
        "meta": kwargs
    })
    notify_group(group, serializer.data)
Пример #4
0
def notify_event_updated(event, **kwargs):
    group = group_for_event(event)
    serializer = EventReadDetailedSocketSerializer({
        'type': 'SOCKET_EVENT_UPDATED',
        'payload': event,
        'meta': kwargs
    })

    notify_group(group, serializer.data)
Пример #5
0
def notify_event_registration(action_type, registration, **kwargs):
    group = group_for_event(registration.event)
    kwargs['event_id'] = registration.event.id
    serializer = RegistrationReadSocketSerializer({
        'type': action_type,
        'payload': registration,
        'meta': kwargs
    })
    notify_group(group, serializer.data)
Пример #6
0
def notify_event_updated(event, **kwargs):
    full_access_group = group_for_event(event, True)
    limited_access_group = group_for_event(event, False)
    serializer = EventReadDetailedSocketSerializer(
        {"type": "SOCKET_EVENT_UPDATED", "payload": event, "meta": kwargs}
    )

    notify_group(full_access_group, serializer.data)
    notify_group(limited_access_group, serializer.data)
Пример #7
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)
Пример #8
0
def notify_event_registration(action_type, registration, **kwargs):
    full_access_group = group_for_event(registration.event, True)
    partial_access_group = group_for_event(registration.event, False)

    kwargs["event_id"] = registration.event.id
    full_serializer = RegistrationReadSocketSerializer(
        {"type": action_type, "payload": registration, "meta": kwargs}
    )
    partial_serializer = RegistrationReadAnonymizedSocketSerializer(
        {"type": action_type, "payload": registration, "meta": kwargs}
    )

    notify_group(full_access_group, full_serializer.data)
    notify_group(partial_access_group, partial_serializer.data)