yuripeyamashita commited on
Commit
bd4d44f
·
verified ·
1 Parent(s): 696d3f8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -22,8 +22,8 @@ def api():
22
  try:
23
  payload = get_payload_dict(request.get_json())
24
 
25
- if payload.get("group_id") != GROUP_ID:
26
- raise ValueError("Invalid Group")
27
 
28
  if payload.get("unsend_msg_id"):
29
  unsend_msg_id = payload.get("unsend_msg_id")
@@ -93,14 +93,14 @@ def api():
93
  if amount < 0:
94
  result.append({"from": get_username(users[j]), "to": get_username(users[i]), "amount": -amount})
95
 
96
- sorted_result = sorted(result, key=lambda x: x["from"])
 
97
 
98
- for r in sorted_result:
99
- print(r)
100
 
101
- bubble = get_checkout_bubble(sorted_result)
102
- print(bubble)
103
- send_flex_text(payload.get("token"), bubble)
104
 
105
  raise ValueError("Action Success")
106
 
 
22
  try:
23
  payload = get_payload_dict(request.get_json())
24
 
25
+ # if payload.get("group_id") != GROUP_ID:
26
+ # raise ValueError("Invalid Group")
27
 
28
  if payload.get("unsend_msg_id"):
29
  unsend_msg_id = payload.get("unsend_msg_id")
 
93
  if amount < 0:
94
  result.append({"from": get_username(users[j]), "to": get_username(users[i]), "amount": -amount})
95
 
96
+ if result:
97
+ sorted_result = sorted(result, key=lambda x: x["from"])
98
 
99
+ for r in sorted_result:
100
+ print(r)
101
 
102
+ bubble = get_checkout_bubble(sorted_result)
103
+ send_flex_text(payload.get("token"), bubble)
 
104
 
105
  raise ValueError("Action Success")
106