(self)
Stop synchronisation with other clients
Stop synchronisation with other clients
Stop synchronisation with other clients
def stop_sync(self):
        """Stop synchronisation with other clients"""
        sg = self.sync_group

        logger.info("Stopping synchronisation of %r", self)
        self.sync_group = None
        self.save()

        clients = Client.objects.filter(sync_group=sg)
        logger.info("%d other clients remaining in sync group", len(clients))

        if len(clients) < 2:
            logger.info("Deleting sync group %r", sg)
            for client in clients:
                client.sync_group = None
                client.save()

            sg.delete()
def stop_sync ( self ) : sg = self . sync_group logger . info ( "Stopping synchronisation of %r" , self ) self . sync_group = None self . save ( ) clients = Client . objects . filter ( sync_group = sg ) logger . info ( "%d other clients remaining in sync group" , len ( clients ) ) if len ( clients ) < 2 : logger . info ( "Deleting sync group %r" , sg ) for client in clients : client . sync_group = None client . save ( ) sg . delete ( )