mirror of
				https://gitlab.crans.org/bde/nk20-scripts
				synced 2025-10-30 22:59:52 +01:00 
			
		
		
		
	Fix linters
This commit is contained in:
		| @@ -18,10 +18,15 @@ class Command(BaseCommand): | |||||||
|         return parser |         return parser | ||||||
|  |  | ||||||
|     def handle(self, *args, **kwargs): |     def handle(self, *args, **kwargs): | ||||||
|         queryset = RecurrentTransaction.objects.filter(template__display=True, created_at__gte=timezone.now() - timedelta(days=30)).values("template").annotate(transaction_count=Count("template")).order_by("-transaction_count")[:10] |         queryset = RecurrentTransaction.objects.filter( | ||||||
|  |             template__display=True, | ||||||
|  |             valid=True, | ||||||
|  |             created_at__gte=timezone.now() - timedelta(days=30), | ||||||
|  |         ).values("template").annotate(transaction_count=Count("template")).order_by("-transaction_count")[:10] | ||||||
|         for d in queryset.all(): |         for d in queryset.all(): | ||||||
|             button_id = d["template"] |             button_id = d["template"] | ||||||
|             button = TransactionTemplate.objects.get(pk=button_id) |             button = TransactionTemplate.objects.get(pk=button_id) | ||||||
|             self.stdout.write(self.style.WARNING("Highlight button {name} ({count:d} transactions)...".format(name=button.name, count=d["transaction_count"]))) |             self.stdout.write(self.style.WARNING("Highlight button {name} ({count:d} transactions)..." | ||||||
|  |                                                  .format(name=button.name, count=d["transaction_count"]))) | ||||||
|             button.highlighted = True |             button.highlighted = True | ||||||
|             button.save() |             button.save() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user