Skip to content

Commit

Permalink
fix isort, flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
lcduong committed Oct 10, 2024
1 parent 76db223 commit 43eee93
Show file tree
Hide file tree
Showing 123 changed files with 3,547 additions and 2,948 deletions.
5 changes: 3 additions & 2 deletions src/pretix/api/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Generated by Django 4.2.11 on 2024-05-08 01:59

from django.db import migrations, models
import uuid

import django.db.models.deletion
import oauth2_provider.generators
import uuid
from django.db import migrations, models


class Migration(migrations.Migration):
Expand Down
2 changes: 1 addition & 1 deletion src/pretix/api/migrations/0002_initial.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Generated by Django 4.2.11 on 2024-05-08 01:59

import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Generated by Django 4.2.15 on 2024-08-30 08:15

from django.db import migrations, models
import oauth2_provider.generators
import oauth2_provider.models
from django.db import migrations, models


class Migration(migrations.Migration):
Expand Down
2 changes: 1 addition & 1 deletion src/pretix/api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
)
from oauth2_provider.models import (
AbstractAccessToken, AbstractApplication, AbstractGrant, AbstractIDToken,
AbstractRefreshToken, ClientSecretField
AbstractRefreshToken, ClientSecretField,
)
from oauth2_provider.validators import URIValidator

Expand Down
1 change: 0 additions & 1 deletion src/pretix/api/serializers/i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,3 @@ def to_internal_value(self, value) -> LazyI18nString:
url_validator(value.data)

return value

6 changes: 3 additions & 3 deletions src/pretix/api/serializers/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
from pretix.base.decimal import round_decimal
from pretix.base.i18n import language
from pretix.base.models import (
CachedFile, Checkin, Invoice, Customer, InvoiceAddress, InvoiceLine, Item,
CachedFile, Checkin, Customer, Invoice, InvoiceAddress, InvoiceLine, Item,
ItemVariation, Order, OrderPosition, Question, QuestionAnswer, Seat,
SubEvent, TaxRule, Voucher
SubEvent, TaxRule, Voucher,
)
from pretix.base.models.orders import (
CartPosition, OrderFee, OrderPayment, OrderRefund, RevokedTicketSecret,
Expand Down Expand Up @@ -591,7 +591,7 @@ class Meta:
'code', 'status', 'testmode', 'secret', 'email', 'phone', 'locale', 'datetime', 'expires', 'payment_date',
'payment_provider', 'fees', 'total', 'comment', 'invoice_address', 'positions', 'downloads',
'checkin_attention', 'last_modified', 'payments', 'refunds', 'require_approval', 'sales_channel',
'url', 'customer'
'url', 'customer'
)
read_only_fields = (
'code', 'status', 'testmode', 'secret', 'datetime', 'expires', 'payment_date',
Expand Down
4 changes: 2 additions & 2 deletions src/pretix/api/serializers/organizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
from pretix.base.auth import get_auth_backends
from pretix.base.i18n import get_language_without_region
from pretix.base.models import (
Device, GiftCard, GiftCardTransaction, Organizer, SeatingPlan, Team,
TeamAPIToken, TeamInvite, User, Customer,
Customer, Device, GiftCard, GiftCardTransaction, Organizer, SeatingPlan,
Team, TeamAPIToken, TeamInvite, User,
)
from pretix.base.models.seating import SeatingPlanLayoutValidator
from pretix.base.services.mail import SendMailException, mail
Expand Down
3 changes: 1 addition & 2 deletions src/pretix/api/urls.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import importlib

from django.apps import apps
from django.urls import include
from django.urls import re_path as url
from django.urls import include, re_path as url
from rest_framework import routers

from pretix.api.views import cart
Expand Down
5 changes: 3 additions & 2 deletions src/pretix/api/views/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
)
from pretix.api.views import ConditionalListView
from pretix.base.models import (
CartPosition, Device, Event, TaxRule, TeamAPIToken, Organizer, Customer, Order,
CartPosition, Customer, Device, Event, Order, Organizer, TaxRule,
TeamAPIToken,
)
from pretix.base.models.event import SubEvent
from pretix.base.settings import SETTINGS_AFFECTING_CSS
Expand Down Expand Up @@ -429,7 +430,7 @@ def get(self, request, *args, **kwargs):
# Get all orders of customer which belong to this event
order_list = (Order.objects.filter(Q(event=event)
& (Q(customer=customer) | Q(
email__iexact=customer.email))).select_related('event').order_by('-datetime'))
email__iexact=customer.email))).select_related('event').order_by('-datetime'))

if not order_list:
return JsonResponse(status=404, data={"error": "Customer has no orders for this event."})
Expand Down
2 changes: 1 addition & 1 deletion src/pretix/api/views/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ def create(self, request, *args, **kwargs):
with transaction.atomic():
try:
self.perform_create(serializer)
except TaxRule.SaleNotAllowed:
except TaxRule.SaleNotAllowedException:
raise ValidationError(_('One of the selected products is not available in the selected country.'))
send_mail = serializer._send_mail
order = serializer.instance
Expand Down
12 changes: 6 additions & 6 deletions src/pretix/api/views/organizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@

from pretix.api.models import OAuthAccessToken
from pretix.api.serializers.organizer import (
DeviceSerializer, GiftCardSerializer, GiftCardTransactionSerializer,
OrganizerSerializer, OrganizerSettingsSerializer, SeatingPlanSerializer,
TeamAPITokenSerializer, TeamInviteSerializer, TeamMemberSerializer,
TeamSerializer, CustomerSerializer, CustomerCreateSerializer,
CustomerCreateSerializer, CustomerSerializer, DeviceSerializer,
GiftCardSerializer, GiftCardTransactionSerializer, OrganizerSerializer,
OrganizerSettingsSerializer, SeatingPlanSerializer, TeamAPITokenSerializer,
TeamInviteSerializer, TeamMemberSerializer, TeamSerializer,
)
from pretix.base.models import (
Device, GiftCard, GiftCardTransaction, Organizer, SeatingPlan, Team,
TeamAPIToken, TeamInvite, User, Customer,
Customer, Device, GiftCard, GiftCardTransaction, Organizer, SeatingPlan,
Team, TeamAPIToken, TeamInvite, User,
)
from pretix.base.settings import SETTINGS_AFFECTING_CSS
from pretix.helpers.dicts import merge_dicts
Expand Down
Loading

0 comments on commit 43eee93

Please sign in to comment.