Skip to content

Commit c08f436

Browse files
committed
Fix list plans and subscriptions
1 parent 597c3d5 commit c08f436

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

juno/resources/handler_request.py

+6
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,19 @@ def get_data_payments(data):
9191

9292

9393
def get_data_plans(data, method):
94+
if "_embedded" not in data:
95+
return {"plans": []}
96+
9497
if len(data["_embedded"]["plans"]) == 1 and method == "POST":
9598
return {"plan": Plan(data["_embedded"]["plans"][0])}
9699

97100
return {"plans": [Plan(plan_dict) for plan_dict in data["_embedded"]["plans"]]}
98101

99102

100103
def get_data_subscriptions(data, method):
104+
if "_embedded" not in data:
105+
return {"subscriptions": []}
106+
101107
if len(data["_embedded"]["subscriptions"]) == 1 and method == "POST":
102108
return {"subscription": Subscription(data["_embedded"]["subscriptions"][0])}
103109

juno/sdk.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
VERSION = "0.4.0"
1+
VERSION = "0.4.1"
22
API_VERSION = "2"

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
setup(
1212
name="juno-python",
13-
version="0.4.0",
13+
version="0.4.1",
1414
url="https://github.com/mjr/juno-python",
1515
author=__author__,
1616
author_email=__author_email__,

0 commit comments

Comments
 (0)