Skip to content

Commit aa2eda1

Browse files
committed
Fix keys() deprecated warning
1 parent c0a673f commit aa2eda1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

rctab/routers/accounting/allocations.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ async def check_allocation(allocation: Allocation) -> None:
2626
subscription_summary = await get_subscriptions_summary(sub_id=allocation.sub_id)
2727

2828
# Get the first row (should only be one)
29-
subscription_summary = SubscriptionSummary(**subscription_summary[0])
29+
# pylint: disable=protected-access
30+
subscription_summary = SubscriptionSummary(**subscription_summary[0]._mapping)
31+
# pylint: enable=protected-access
3032

3133
if not subscription_summary.approved_to:
3234
raise HTTPException(

rctab/routers/accounting/approvals.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ async def check_approval(approval: Approval) -> None:
110110
subscription_summary = await get_subscriptions_summary(sub_id=approval.sub_id)
111111

112112
# Get the first row (should only be one)
113-
subscription_summary = SubscriptionSummary(**subscription_summary[0])
113+
# pylint: disable=protected-access
114+
subscription_summary = SubscriptionSummary(**subscription_summary[0]._mapping)
115+
# pylint: enable=protected-access
114116

115117
current_date = datetime.date.today()
116118

0 commit comments

Comments
 (0)