getredash / redash-toolbelt

API client and utilities to manage a Redash instance
BSD 2-Clause "Simplified" License
140 stars 74 forks source link

Do not import favorites for disabled users #57

Closed bmtKIA6 closed 3 years ago

bmtKIA6 commented 3 years ago

At the moment import_favorites fails if there are ANY disabled users on the origin.

If we perform /api/queries/favorites for a disabled user, we get a 404, which causes https://github.com/getredash/redash-toolbelt/blob/24f1f9b5a1a4f0edea6f3a17df92910af7b1e4a3/redash_toolbelt/client.py#L199 to blow up and stop importing any favorites.

This PR checks if the user is disabled before performing any queries, and if the user is disabled, the import_favorites does not execute

susodapop commented 3 years ago

Can you please describe what issue this PR aims to fix and how it does so?

bmtKIA6 commented 3 years ago

Can you please describe what issue this PR aims to fix and how it does so?

Updated the description.