mirror of
https://github.com/pretix/pretix.git
synced 2026-05-10 16:04:02 +00:00
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 (
|
from pretix.base.models import (
|
||||||
Event, Organizer, Item, ItemVariation,
|
Event, Organizer, Item, ItemVariation,
|
||||||
Property, PropertyValue, User, Quota,
|
Property, PropertyValue, User, Quota,
|
||||||
Order, OrderPosition, CartPosition,
|
Order, OrderPosition, CartPosition)
|
||||||
OrganizerSetting)
|
|
||||||
from pretix.base.types import VariationDict
|
from pretix.base.types import VariationDict
|
||||||
from pretix.base import settings
|
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), {
|
response = self.client.post('/%s/%s/cart/remove' % (self.orga.slug, self.event.slug), {
|
||||||
'item_' + self.ticket.identity: '1',
|
'item_' + self.ticket.identity: '1',
|
||||||
}, follow=True)
|
}, follow=True)
|
||||||
doc = BeautifulSoup(response.rendered_content)
|
doc = BeautifulSoup(response.rendered_content)
|
||||||
self.assertIn('updated', doc.select('.alert-success')[0].text)
|
self.assertIn('updated', doc.select('.alert-success')[0].text)
|
||||||
self.assertEqual(CartPosition.objects.current.filter(user=self.user, event=self.event).count(), 1)
|
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), {
|
response = self.client.post('/%s/%s/cart/remove' % (self.orga.slug, self.event.slug), {
|
||||||
'item_' + self.ticket.identity: '2',
|
'item_' + self.ticket.identity: '2',
|
||||||
}, follow=True)
|
}, follow=True)
|
||||||
doc = BeautifulSoup(response.rendered_content)
|
doc = BeautifulSoup(response.rendered_content)
|
||||||
self.assertIn('updated', doc.select('.alert-success')[0].text)
|
self.assertIn('updated', doc.select('.alert-success')[0].text)
|
||||||
self.assertFalse(CartPosition.objects.current.filter(user=self.user, event=self.event).exists())
|
self.assertFalse(CartPosition.objects.current.filter(user=self.user, event=self.event).exists())
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import datetime
|
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
|
from pretix.base.tests import BrowserTest
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import uuid
|
|
||||||
from itertools import groupby
|
from itertools import groupby
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from django.contrib.auth.views import redirect_to_login
|
from django.contrib.auth.views import redirect_to_login
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ from django import forms
|
|||||||
from django.shortcuts import redirect
|
from django.shortcuts import redirect
|
||||||
from django.utils.functional import cached_property
|
from django.utils.functional import cached_property
|
||||||
from django.utils.timezone import now
|
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 django.utils.translation import ugettext_lazy as _
|
||||||
from pretix.base.models import CartPosition, Question, QuestionAnswer, Quota, Order, OrderPosition
|
from pretix.base.models import CartPosition, Question, QuestionAnswer, Quota, Order, OrderPosition
|
||||||
from pretix.base.signals import register_payment_providers
|
from pretix.base.signals import register_payment_providers
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class OrderDetailMixin:
|
|||||||
user=self.request.user,
|
user=self.request.user,
|
||||||
event=self.request.event,
|
event=self.request.event,
|
||||||
code=self.kwargs['order'],
|
code=self.kwargs['order'],
|
||||||
)
|
)
|
||||||
except Order.DoesNotExist:
|
except Order.DoesNotExist:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[flake8]
|
[flake8]
|
||||||
ignore = E128,N802,W503
|
ignore = N802,W503
|
||||||
max-line-length = 160
|
max-line-length = 160
|
||||||
exclude = migrations,.ropeproject,static
|
exclude = migrations,.ropeproject,static
|
||||||
max-complexity = 16
|
max-complexity = 16
|
||||||
|
|||||||
Reference in New Issue
Block a user