def update_user_auth_stat(self, user, success=True):
if not user.login_count:<EOL><INDENT>user.login_count = <NUM_LIT:0><EOL><DEDENT>if not user.fail_login_count:<EOL><INDENT>user.fail_login_count = <NUM_LIT:0><EOL><DEDENT>if success:<EOL><INDENT>user.login_count += <NUM_LIT:1><EOL>user.fail_login_count = <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>user.fail_login_count += <NUM_LIT:1><EOL><DEDENT>user.last_login = datetime.datetime.now()<EOL>self.update_user(user)<EOL>
Update authentication successful to user.

:param user:
    The authenticated user model
:param success:
    Default to true, if false increments fail_login_count on user model