Always randomize supplier articles

This commit is contained in:
Ludovic Stephan 2017-03-29 23:22:18 -03:00
parent 95c59de4fc
commit 56b5fd6279

View file

@ -132,9 +132,7 @@ class Command(MyBaseCommand):
supplier, created = Supplier.objects.get_or_create(name="Panoramix")
if created:
articles = Article.objects.filter(category__name="Autres Bieres")
if not articles.exists():
articles = random.sample(Article.objects.all(), 30)
articles = random.sample(list(Article.objects.all()), 40)
to_create = []
for article in articles:
to_create.append(SupplierArticle(