Remove async and update CRUD helpers

This commit is contained in:
2022-11-29 07:20:39 +00:00
parent c54b3e5412
commit 84be2a7278
7 changed files with 117 additions and 39 deletions

View File

@@ -1,14 +1,12 @@
from asgiref.sync import sync_to_async
from core.models import Plan
async def assemble_plan_map(product_id_filter=None):
def assemble_plan_map(product_id_filter=None):
"""
Get all the plans from the database and create an object Stripe wants.
"""
line_items = []
for plan in await sync_to_async(list)(Plan.objects.all()):
for plan in Plan.objects.all():
if product_id_filter:
if plan.product_id != product_id_filter:
continue