Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update code to current API v2 #42

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion patreon/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -135,4 +139,4 @@ def __as_utc(dt):
return dt.astimezone(utc_timezone())
else:
return dt.replace(tzinfo=utc_timezone())
return dt
return dt
2 changes: 2 additions & 0 deletions patreon/schemas/member.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'


Expand Down