Commit 09eba9f7 authored by Birin Sanchez's avatar Birin Sanchez

* Return None subscriptions for users without WC account

* Save error message in ExternalCredit.error_message
Signed-off-by: Birin Sanchez's avatarBirin Sanchez <>
parent 8cd1e17a
......@@ -76,6 +76,9 @@ def parse_subscription(json_entry):
def get_user_subscriptions(user):
user_wc_id = user.get_woocommerce_id()
if user_wc_id is None:
# The user does not have WC account
return None
woo = get_woo_connection()
subscriptions = woo.get(
......@@ -160,11 +163,12 @@ def process_pending_registrations_user(user):
if hasattr(user, 'chosenreward'):
user.chosenreward.is_pending = is_pending
ext_cred.error_message = error
if is_pending:'Subscription {} for user {} found error: '
'{}'.format(parsed_sub['label'], user.username,
else:'Subscription {} for user {} was processed '
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment