From 5c757a95c358e17df7951f7d6cda8710bd49ccfd Mon Sep 17 00:00:00 2001 From: Santiago Lamora Date: Mon, 25 Sep 2023 09:31:06 +0200 Subject: [PATCH 1/2] Add missing member attributes --- patreon/schemas/member.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/patreon/schemas/member.py b/patreon/schemas/member.py index a89cc5d..cba491c 100644 --- a/patreon/schemas/member.py +++ b/patreon/schemas/member.py @@ -9,11 +9,13 @@ class Attributes(object): full_name = 'full_name' email = 'email' pledge_relationship_start = 'pledge_relationship_start' + pledge_cadence = 'pledge_cadence' lifetime_support_cents = 'lifetime_support_cents' currently_entitled_amount_cents = 'currently_entitled_amount_cents' last_charge_date = 'last_charge_date' last_charge_status = 'last_charge_status' note = 'note' + next_charge_date = 'next_charge_date' will_pay_amount_cents = 'will_pay_amount_cents' From e530a61c0848b7731d8d12cc1219f9ffda0d673e Mon Sep 17 00:00:00 2001 From: Santiago Lamora Date: Mon, 25 Sep 2023 09:33:09 +0200 Subject: [PATCH 2/2] Fix API.extract_cursor() Raises exception: `Provided cursor path did not result in a link` when cursor reaches the end of the iterator. --- patreon/api.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/patreon/api.py b/patreon/api.py index 65427d7..20db40c 100644 --- a/patreon/api.py +++ b/patreon/api.py @@ -97,6 +97,10 @@ def head_and_tail(path): # Path was valid until leaf, at which point nothing was found if current_dict is None or (head is not None and tail is None): return None + + elif type(current_dict) == dict and head not in current_dict: + return None + # Path stopped before leaf was reached elif current_dict and type(current_dict) != six.text_type: raise Exception( @@ -135,4 +139,4 @@ def __as_utc(dt): return dt.astimezone(utc_timezone()) else: return dt.replace(tzinfo=utc_timezone()) - return dt \ No newline at end of file + return dt