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)
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)
def find_groups(user): return ["global", group_for_user(user)] + find_event_groups(user)