Skip to content

Commit

Permalink
style: fix import sorting
Browse files Browse the repository at this point in the history
KK-1113
  • Loading branch information
nikomakela committed Dec 20, 2024
1 parent 46c94d8 commit 07b1261
Show file tree
Hide file tree
Showing 22 changed files with 33 additions and 46 deletions.
2 changes: 1 addition & 1 deletion children/notifications.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.utils.translation import gettext_lazy as _

from django_ilmoitin.dummy_context import dummy_context
from django_ilmoitin.registry import notifications

from projects.factories import ProjectFactory
from users.factories import GuardianFactory

Expand Down
2 changes: 1 addition & 1 deletion children/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from django.db.models import F, Q
from django.utils import timezone as django_utils_timezone
from django.utils.timezone import localdate, make_aware
from django_ilmoitin.utils import send_notification
from graphene import relay
from graphene_django import DjangoConnectionField
from graphene_django.types import DjangoObjectType
Expand All @@ -21,7 +22,6 @@
set_obj_languages_spoken_at_home,
)
from common.utils import login_required, map_enums_to_values_in_kwargs, update_object
from django_ilmoitin.utils import send_notification
from events.models import Event, EventGroup, EventQueryset, Occurrence
from hel_django_auditlog_extra.graphene_decorators import auditlog_access
from kukkuu.exceptions import (
Expand Down
6 changes: 3 additions & 3 deletions children/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
UPDATE_CHILD_NOTES_MUTATION_TEMPLATE,
)
from children.tests.queries import (
CHILDREN_FILTER_QUERY,
CHILDREN_PAGINATION_QUERY,
CHILDREN_QUERY,
CHILD_ACTIVE_INTERNAL_AND_TICKETMASTER_ENROLMENTS_QUERY,
CHILD_AVAILABLE_EVENTS_AND_EVENT_GROUPS_QUERY,
CHILD_ENROLMENT_COUNT_QUERY,
Expand All @@ -36,6 +33,9 @@
CHILD_PAST_EVENTS_QUERY,
CHILD_QUERY,
CHILD_UPCOMING_EVENTS_AND_EVENT_GROUPS_QUERY,
CHILDREN_FILTER_QUERY,
CHILDREN_PAGINATION_QUERY,
CHILDREN_QUERY,
)
from common.tests.utils import (
assert_error_message,
Expand Down
2 changes: 1 addition & 1 deletion common/tests/utils.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from django.core import mail
from django_ilmoitin.models import NotificationTemplate
from parler.utils.context import switch_language
from requests.exceptions import HTTPError

from django_ilmoitin.models import NotificationTemplate
from kukkuu.consts import GENERAL_ERROR, PERMISSION_DENIED_ERROR


Expand Down
4 changes: 2 additions & 2 deletions events/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from django_ilmoitin.dummy_context import dummy_context
from django_ilmoitin.registry import notifications

from children.factories import ChildWithGuardianFactory
from common.utils import get_global_id
from django_ilmoitin.dummy_context import dummy_context
from django_ilmoitin.registry import notifications
from events.consts import NotificationType
from events.factories import (
EnrolmentFactory,
Expand Down
14 changes: 7 additions & 7 deletions events/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
EventGroupFactory,
LippupisteEventFactory,
OccurrenceFactory,
TicketSystemPasswordFactory,
TicketmasterEventFactory,
TicketSystemPasswordFactory,
TixlyEventFactory,
)
from events.models import Enrolment, Event, EventGroup, Occurrence, TicketSystemPassword
Expand All @@ -46,26 +46,26 @@
UPDATE_EVENT_GROUP_MUTATION,
UPDATE_EVENT_MUTATION,
UPDATE_OCCURRENCE_MUTATION,
UPDATE_TICKETMASTER_EVENT_MUTATION,
UPDATE_TICKET_ATTENDED_MUTATION,
UPDATE_TICKETMASTER_EVENT_MUTATION,
)
from events.tests.queries import (
CAN_CHILD_ENROLL_EVENT_QUERY,
EVENTS_AND_EVENT_GROUPS_SIMPLE_QUERY,
EVENTS_FILTER_QUERY,
EVENTS_QUERY,
EVENT_GROUP_EVENTS_FILTER_QUERY,
EVENT_GROUP_QUERY,
EVENT_QUERY,
EVENT_TICKET_SYSTEM_HAS_ANY_FREE_PASSWORDS_QUERY,
EVENT_TICKET_SYSTEM_PASSWORD_COUNTS_QUERY,
EVENT_TICKET_SYSTEM_PASSWORD_QUERY,
EVENTS_AND_EVENT_GROUPS_SIMPLE_QUERY,
EVENTS_FILTER_QUERY,
EVENTS_QUERY,
GET_ENROLMENT_REFERENCE_ID_QUERY,
OCCURRENCE_QUERY,
OCCURRENCE_TICKET_SYSTEM_QUERY,
OCCURRENCES_COUNTS_QUERY_TEMPLATE,
OCCURRENCES_FILTER_QUERY,
OCCURRENCES_QUERY,
OCCURRENCE_QUERY,
OCCURRENCE_TICKET_SYSTEM_QUERY,
VERIFY_TICKET_QUERY,
)
from events.ticket_service import check_ticket_validity
Expand Down
2 changes: 1 addition & 1 deletion events/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
EventGroupFactory,
LippupisteEventFactory,
OccurrenceFactory,
TicketSystemPasswordFactory,
TicketmasterEventFactory,
TicketSystemPasswordFactory,
TixlyEventFactory,
)
from ..models import Enrolment, Event, EventGroup, Occurrence
Expand Down
4 changes: 2 additions & 2 deletions events/utils.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import logging
from collections.abc import Iterable
from datetime import datetime
from typing import List, Optional, TYPE_CHECKING, Union
from typing import TYPE_CHECKING, List, Optional, Union

from django.conf import settings
from django.db.models import QuerySet
from django.utils import timezone
from django_ilmoitin.utils import send_notification
from parler.utils.context import switch_language

from common.utils import get_global_id
from django_ilmoitin.utils import send_notification
from users.utils import get_communication_unsubscribe_ui_url

if TYPE_CHECKING:
Expand Down
2 changes: 1 addition & 1 deletion gdpr/service.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import logging
from typing import Optional, TYPE_CHECKING
from typing import TYPE_CHECKING, Optional

from helsinki_gdpr.types import ErrorResponse

Expand Down
1 change: 0 additions & 1 deletion importers/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from django.urls import path, reverse
from django.utils.translation import gettext_lazy as _
from django.utils.translation import ngettext_lazy

from django_ilmoitin.admin import NotificationTemplateAdmin
from django_ilmoitin.models import NotificationTemplate

Expand Down
5 changes: 2 additions & 3 deletions importers/notification_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.db import transaction
from parler.utils.context import switch_language
from requests import RequestException

from django_ilmoitin.dummy_context import dummy_context
from django_ilmoitin.models import NotificationTemplate, NotificationTemplateException
from django_ilmoitin.utils import render_notification_template
from parler.utils.context import switch_language
from requests import RequestException

# {
# "<notification type>": {
Expand Down
2 changes: 1 addition & 1 deletion importers/tests/test_notification_importer.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import pytest
import responses
from django.conf import settings
from django_ilmoitin.models import NotificationTemplate

from common.tests.utils import create_notification_template_in_language
from django_ilmoitin.models import NotificationTemplate
from events.notifications import NotificationType

from ..notification_importer import NotificationImporter
Expand Down
2 changes: 1 addition & 1 deletion kukkuu/tests/utils/jwt_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import time
import uuid
from typing import Optional, TYPE_CHECKING
from typing import TYPE_CHECKING, Optional

from django.conf import settings
from jose import jwt
Expand Down
2 changes: 1 addition & 1 deletion kukkuu_mailer_admin/admin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.contrib import admin
from django.utils.translation import gettext_lazy as _
from mailer.admin import MessageAdmin, MessageLogAdmin, show_to
from mailer.models import Message, MessageLog, RESULT_CODES
from mailer.models import RESULT_CODES, Message, MessageLog

from hel_django_auditlog_extra.mixins import AuditlogAdminViewAccessLogMixin

Expand Down
4 changes: 2 additions & 2 deletions messaging/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

from django.conf import settings
from django.utils import timezone
from parler.utils.context import switch_language

from django_ilmoitin.utils import Message as MailerMessage
from django_ilmoitin.utils import send_all, send_mail
from parler.utils.context import switch_language

from kukkuu.notification_service import send_sms_notification
from messaging.exceptions import AlreadySentError
from users.models import Guardian
Expand Down
10 changes: 0 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,7 @@ ignore = [
[tool.ruff.lint.isort]
# isort options for ruff:
# https://docs.astral.sh/ruff/settings/#lintisort
case-sensitive = true
order-by-type = false # Don't use type (i.e. case) to sort imports
known-first-party = ["kukkuu"]
default-section = "third-party"
section-order = [
"future",
"standard-library",
"third-party",
"first-party",
"local-folder",
]

[tool.ruff.format]
docstring-code-format = true # Format code in docstrings
Expand Down
2 changes: 1 addition & 1 deletion subscriptions/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional, TYPE_CHECKING, Union
from typing import TYPE_CHECKING, Optional, Union

from django.core.exceptions import ValidationError
from django.db import models
Expand Down
4 changes: 2 additions & 2 deletions subscriptions/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

from django.utils import timezone
from django.utils.translation import gettext_lazy as _

from children.factories import ChildWithGuardianFactory
from django_ilmoitin.dummy_context import dummy_context
from django_ilmoitin.registry import notifications

from children.factories import ChildWithGuardianFactory
from events.factories import EventFactory, OccurrenceFactory
from events.utils import (
get_event_ui_url,
Expand Down
4 changes: 2 additions & 2 deletions users/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
from django.http import HttpResponse
from django.utils.safestring import mark_safe
from django.utils.translation import gettext_lazy as _
from django_ilmoitin.models import NotificationTemplate
from django_ilmoitin.utils import render_notification_template
from guardian.admin import GuardedModelAdmin

from children.models import Relationship
from django_ilmoitin.models import NotificationTemplate
from django_ilmoitin.utils import render_notification_template
from hel_django_auditlog_extra.mixins import AuditlogAdminViewAccessLogMixin
from languages.models import Language
from projects.models import Project
Expand Down
2 changes: 1 addition & 1 deletion users/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging
from datetime import datetime
from typing import Optional, TYPE_CHECKING, Union
from typing import TYPE_CHECKING, Optional, Union

from django.conf import settings
from django.contrib.auth import get_user_model
Expand Down
1 change: 0 additions & 1 deletion users/notifications.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from datetime import date

from django.utils.translation import gettext_lazy as _

from django_ilmoitin.dummy_context import dummy_context
from django_ilmoitin.registry import notifications

Expand Down
2 changes: 1 addition & 1 deletion users/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from django.core.paginator import Paginator
from django.db.models import QuerySet
from django.template import Context, Template

from django_ilmoitin.utils import send_notification

from users.models import Guardian
from users.utils import get_communication_unsubscribe_ui_url

Expand Down

0 comments on commit 07b1261

Please sign in to comment.