Commit ca22ce6b authored by Antoine Millet's avatar Antoine Millet
Browse files

Unregistering process now delete object from objectdb if it's not attached to an account.

parent b35d7c3e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -133,6 +133,12 @@ class CCServer(object):
        '''

        client = self.search_client_by_connection(connection)

        # Unregister objects from database if it have no account attached:
        obj = self.objects.get(client.login)
        if obj is not None and 'a' not in obj:
            self.objects.unregister(obj['id'])

        if client.login in self._connected:
            del self._connected[client.login]
        self.objects.unregister_children(client.login)