1
0
Fork 0

utils/export_as_csv: Catch more-specific TypeError instead of broad Exception (W0703)

Fixes the broad-except (W0703) pylint error.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
merge-requests/870/head
Fabian P. Schmidt 2020-01-02 22:40:35 +01:00
parent 4c9cd66661
commit 02eda83a84
3 changed files with 1 additions and 3 deletions

View File

@ -10,4 +10,3 @@ disable=
R0912, # too-many-branches
R0913, # too-many-arguments
R0914, # too-many-locals
W0703, # broad-except

View File

@ -12,4 +12,3 @@ disable=
R0912, # too-many-branches
R0913, # too-many-arguments
R0914, # too-many-locals
W0703, # broad-except

View File

@ -48,7 +48,7 @@ def export_as_csv(modeladmin, request, queryset):
try:
# get value from model
value = value()
except Exception:
except TypeError:
# get value from modeladmin e.g: admin_method_1
value = value(row)
if value is None: