Skip to content

Commit

Permalink
Source Typeform #6319 - fixing check connections
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaliizazmic committed Oct 5, 2021
1 parent e7b1064 commit 7f83393
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,12 @@ def check_connection(self, logger: AirbyteLogger, config: Mapping[str, Any]) ->
try:
form_ids = config.get("form_ids", []).copy()
auth = TokenAuthenticator(token=config["token"])
# check if form valid
# verify if form inputted by user is valid
for form in TrimForms(authenticator=auth, **config).read_records(sync_mode=SyncMode.full_refresh):
if form.get("id") in form_ids:
form_ids.remove(form.get("id"))
if form_ids:
for form in TrimForms(authenticator=auth, **config).read_records(sync_mode=SyncMode.full_refresh):
if form.get("id") in form_ids:
form_ids.remove(form.get("id"))
if form_ids:
return False, f"{form_ids} is not valid IDs"
return False, f"{form_ids} is not valid IDs"
return True, None
except requests.exceptions.RequestException as e:
return False, e
Expand Down

0 comments on commit 7f83393

Please sign in to comment.