codestyle

This commit is contained in:
Mira Weller
2024-08-01 23:01:11 +02:00
parent 106026045e
commit c1a5e8d912
4 changed files with 3 additions and 4 deletions

View File

@@ -459,7 +459,6 @@ class ItemCategorySerializer(I18nAwareModelSerializer):
return data
class QuestionOptionSerializer(I18nAwareModelSerializer):
identifier = serializers.CharField(allow_null=True)

View File

@@ -96,7 +96,7 @@ class CrossSellingService:
match = set(match.pk for match in category.cross_selling_match_products.only('pk')) # TODO prefetch this
return (category.items.all(), {}) if any(pos.item.pk in match for pos in self.cartpositions) else (None, {})
if category.cross_selling_condition == 'discounts':
my_item_pks = [item.id for item in category.items.all()] #category.items.values_list('pk', flat=True)
my_item_pks = [item.id for item in category.items.all()]
potential_discount_items = {
item.pk: (max_count, discount_rule)
for item, max_count, discount_rule in self._potential_discounts_by_item_for_current_cart

View File

@@ -40,7 +40,6 @@ from urllib.parse import urlencode
from django import forms
from django.conf import settings
from django.core.exceptions import ValidationError
from django.core.files.uploadedfile import UploadedFile
from django.db.models import Max, Q
from django.forms import ChoiceField, RadioSelect
from django.forms.formsets import DELETION_FIELD_NAME

View File

@@ -27,10 +27,10 @@ from typing import List, Tuple
import pytest
from django.utils.timezone import now
from django_scopes import scopes_disabled
from tests import assert_num_queries
from pretix.base.models import CartPosition, Discount, Event, Organizer
from pretix.base.services.cross_selling import CrossSellingService
from tests import assert_num_queries
@pytest.fixture
@@ -467,6 +467,7 @@ def test_five_tickets_one_free(event):
'''
)
@scopes_disabled()
@pytest.mark.django_db
@pytest.mark.parametrize("itemcount", [3, 10, 50])