Skip to content

Commit

Permalink
Fix orders
Browse files Browse the repository at this point in the history
  • Loading branch information
piyushroshan committed Feb 7, 2024
1 parent 45c42b6 commit c393df6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions services/workshop/core/management/commands/seed_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,9 @@ def create_orders():
from crapi.shop.models import Order
if Order.objects.all().count() >= 1:
return
users = User.objects.filter(role=User.ROLE_CHOICES.PREDEFINED).order_by('id')
for user in users:
users = User.objects.all().order_by('id')
users_seed = users[:5]
for user in users_seed:
product = Product.objects.filter(name='Seat').first()
order = Order.objects.create(
user=user,
Expand Down

0 comments on commit c393df6

Please sign in to comment.