def remove_user(self, user_id: int): """ Delete user entry for user with specified ListenBrainz user ID. Args: user_id (int): the ListenBrainz row ID of the user """ external_service_oauth.delete_token(user_id=user_id, service=self.service, remove_import_log=True)
def test_delete_token_unlink(self): db_oauth.delete_token(self.user['id'], ExternalServiceType.SPOTIFY, remove_import_log=True) self.assertIsNone( db_oauth.get_token(self.user['id'], ExternalServiceType.SPOTIFY)) self.assertIsNone(db_spotify.get_user_import_details(self.user['id']))
def revoke_user(self, user_id: int): """ Delete the user's connection to external service but retain the last import error message. Args: user_id (int): the ListenBrainz row ID of the user """ external_service_oauth.delete_token(user_id, self.service, remove_import_log=False)