plaid / quickstart

Get up and running with Plaid Link and the API in minutes
https://plaid.com/docs/quickstart
MIT License
602 stars 645 forks source link

Organize imports and fix "e" bug #424

Closed zevaverbach closed 1 year ago

zevaverbach commented 1 year ago

Removed unused variable asset_report_pdf. Removed unused imports:

from flask import render_template
from plaid.exceptions import ApiException
from werkzeug.wrappers import response

Simplified import and usage of datetime functions.

Fixed a bug in while num_retries_remaining > 0 code block, and the line just following it. In both the error_response = ... and if asset_report_json ... blocks, the variable e was unbound. This is resolved by declaring err as None before the block, then assigning to err on each retry. err is then used after the while block.

I also put an else: before the two lines starting with error_response = ... so they would actually run. My assumption is that these were meant to run if the error is anything aside from PRODUCT_NOT_READY, whereas currently the continue statement makes those lines unreachable.