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

Fixed unlocking bug when exception is raised.

parent 415dd1da
Loading
Loading
Loading
Loading
+8 −11
Original line number Diff line number Diff line
@@ -396,16 +396,13 @@ class WelcomeHandler(CCHandler):
        Authenticate the client.
        '''
        conf = self._server.conf
        conf.acquire()
        
        with conf:
            try:
                role = self._server.conf.authentify(login, password)
            except CCConf.UnknownAccount:
            conf.release()
                raise AuthenticationError('Unknown login')
            else:
                if 'close' in self._server.conf.show(login)['tags']:
                conf.release()
                    raise AuthenticationError('Account is closed')

        if role is None: