Change default value of MPD_SERVER_PASSWORD from False to None
This commit is contained in:
parent
7f4ce3be8a
commit
e1197ed84c
@ -85,7 +85,7 @@ class MpdSession(asynchat.async_chat):
|
||||
the response_message is :class:`None`, normal processing should
|
||||
continue, even though the client may not be authenticated.
|
||||
"""
|
||||
if not settings.MPD_SERVER_PASSWORD:
|
||||
if settings.MPD_SERVER_PASSWORD is None:
|
||||
return (True, None)
|
||||
command = request.split(' ')[0]
|
||||
if command == 'password':
|
||||
|
||||
@ -166,8 +166,8 @@ MPD_SERVER_HOSTNAME = u'127.0.0.1'
|
||||
|
||||
#: The password required for connecting to the MPD server.
|
||||
#:
|
||||
#: Default: :class:`False`, which means no password required.
|
||||
MPD_SERVER_PASSWORD = False
|
||||
#: Default: :class:`None`, which means no password required.
|
||||
MPD_SERVER_PASSWORD = None
|
||||
|
||||
#: Which TCP port Mopidy's MPD server should listen to.
|
||||
#:
|
||||
|
||||
@ -36,7 +36,7 @@ class ConnectionHandlerTest(unittest.TestCase):
|
||||
self.assert_(u'ACK [3@0] {password} incorrect password' in result)
|
||||
|
||||
def test_any_password_is_not_accepted_when_password_check_turned_off(self):
|
||||
settings.MPD_SERVER_PASSWORD = False
|
||||
settings.MPD_SERVER_PASSWORD = None
|
||||
result = self.h.handle_request(u'password "secret"')
|
||||
self.assert_(u'ACK [3@0] {password} incorrect password' in result)
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ class MpdSessionTest(unittest.TestCase):
|
||||
self.assertEqual(u'ACK [3@0] {password} incorrect password', response)
|
||||
|
||||
def test_authentication_with_anything_when_password_check_turned_off(self):
|
||||
settings.MPD_SERVER_PASSWORD = False
|
||||
settings.MPD_SERVER_PASSWORD = None
|
||||
authed, response = self.session.check_password(u'any request at all')
|
||||
self.assertTrue(authed)
|
||||
self.assertEqual(None, response)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user