forked from CGM_Public/pretix_original
Resolve flake8 style warnings (mostly unused imports)
This commit is contained in:
@@ -5,8 +5,7 @@ from django.utils.timezone import now
|
||||
from pretix.base.models import (
|
||||
Event, Organizer, Item, ItemVariation,
|
||||
Property, PropertyValue, User, Quota,
|
||||
Order, OrderPosition, CartPosition,
|
||||
OrganizerSetting)
|
||||
Order, OrderPosition, CartPosition)
|
||||
from pretix.base.types import VariationDict
|
||||
from pretix.base import settings
|
||||
|
||||
|
||||
@@ -368,7 +368,7 @@ class CartTest(CartTestMixin, TestCase):
|
||||
)
|
||||
response = self.client.post('/%s/%s/cart/remove' % (self.orga.slug, self.event.slug), {
|
||||
'item_' + self.ticket.identity: '1',
|
||||
}, follow=True)
|
||||
}, follow=True)
|
||||
doc = BeautifulSoup(response.rendered_content)
|
||||
self.assertIn('updated', doc.select('.alert-success')[0].text)
|
||||
self.assertEqual(CartPosition.objects.current.filter(user=self.user, event=self.event).count(), 1)
|
||||
@@ -384,7 +384,7 @@ class CartTest(CartTestMixin, TestCase):
|
||||
)
|
||||
response = self.client.post('/%s/%s/cart/remove' % (self.orga.slug, self.event.slug), {
|
||||
'item_' + self.ticket.identity: '2',
|
||||
}, follow=True)
|
||||
}, follow=True)
|
||||
doc = BeautifulSoup(response.rendered_content)
|
||||
self.assertIn('updated', doc.select('.alert-success')[0].text)
|
||||
self.assertFalse(CartPosition.objects.current.filter(user=self.user, event=self.event).exists())
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import datetime
|
||||
import time
|
||||
|
||||
from pretix.base.models import Item, Organizer, Event, ItemCategory, Quota, Property, PropertyValue, ItemVariation, User
|
||||
from pretix.base.models import Item, Organizer, Event, ItemCategory, Quota, Property, PropertyValue, ItemVariation
|
||||
from pretix.base.tests import BrowserTest
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import uuid
|
||||
from itertools import groupby
|
||||
from datetime import timedelta
|
||||
from django.contrib.auth.views import redirect_to_login
|
||||
|
||||
@@ -7,7 +7,7 @@ from django import forms
|
||||
from django.shortcuts import redirect
|
||||
from django.utils.functional import cached_property
|
||||
from django.utils.timezone import now
|
||||
from django.views.generic import View, TemplateView
|
||||
from django.views.generic import TemplateView
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from pretix.base.models import CartPosition, Question, QuestionAnswer, Quota, Order, OrderPosition
|
||||
from pretix.base.signals import register_payment_providers
|
||||
|
||||
@@ -19,7 +19,7 @@ class OrderDetailMixin:
|
||||
user=self.request.user,
|
||||
event=self.request.event,
|
||||
code=self.kwargs['order'],
|
||||
)
|
||||
)
|
||||
except Order.DoesNotExist:
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user