#NEWLINE# def check_password( self , password ) : #NEWLINE# #INDENT# 'Checks the *internally* stored password against the one supplied.\n        If an external authentication system is used that method is useless.\n        ' #NEWLINE# if ( salt . pw_hash is None ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# ( salt , pwhash ) = self . pw_hash . split ( '$' , 1 ) #NEWLINE# check = sha1 ( ( '%s$%s' % ( salt , password . encode ( 'utf-8' ) ) ) ) . hexdigest ( ) #NEWLINE# return ( check == pwhash )