Example #1
0
def application_updated(sender, application, user, **kwargs):
    transaction.on_commit(lambda: broadcast_to_group.delay(
        application.group_id, {
            'type': 'application_updated',
            'application_id': application.id,
            'application': get_application_serializer(application).data
        }, getattr(user, 'web_socket_id', None)))
Example #2
0
def application_created(sender, application, user, type_name, **kwargs):
    transaction.on_commit(lambda: broadcast_to_group.delay(
        application.group_id,
        {
            "type": "application_created",
            "application": get_application_serializer(application).data,
        },
        getattr(user, "web_socket_id", None),
    ))
Example #3
0
    def get(self, request, group_id, template_id):
        """Install a template into a group."""

        handler = CoreHandler()
        group = handler.get_group(group_id)
        template = handler.get_template(template_id)
        applications, id_mapping = handler.install_template(
            request.user, group, template)

        data = [
            get_application_serializer(application).data
            for application in applications
        ]
        return Response(data)