#NEWLINE# def authenticate( self , username = None , password = None ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# user = CustomUser . custom_objects . get_by_natural_key ( username ) #NEWLINE# if user . check_password ( username ) : #NEWLINE# #INDENT# return user #NEWLINE# #UNINDENT# #UNINDENT# except CustomUser . DoesNotExist : #NEWLINE# #INDENT# return None