Skip to content

Commit

Permalink
style: fix imports order
Browse files Browse the repository at this point in the history
  • Loading branch information
kyrylo-kh committed May 27, 2024
1 parent 6fd2782 commit 3366597
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 31 deletions.
3 changes: 1 addition & 2 deletions credentials/apps/badges/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
from django.contrib.sites.shortcuts import get_current_site
from django.core.management import call_command
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from django.utils.translation import gettext_lazy as _
from django.urls import reverse

from credentials.apps.badges.admin_forms import (
BadgePenaltyForm,
Expand All @@ -21,7 +21,6 @@
PenaltyDataRuleForm,
PenaltyDataRuleFormSet,
)

from credentials.apps.badges.models import (
BadgePenalty,
BadgeProgress,
Expand Down
11 changes: 9 additions & 2 deletions credentials/apps/badges/admin_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,15 @@

from credentials.apps.badges.credly.api_client import CredlyAPIClient
from credentials.apps.badges.credly.exceptions import CredlyAPIError
from credentials.apps.badges.models import AbstractDataRule, BadgePenalty, BadgeRequirement, CredlyOrganization, DataRule, PenaltyDataRule
from credentials.apps.badges.utils import get_event_type_keypaths, get_event_type_attr_type_by_keypath
from credentials.apps.badges.models import (
AbstractDataRule,
BadgePenalty,
BadgeRequirement,
CredlyOrganization,
DataRule,
PenaltyDataRule,
)
from credentials.apps.badges.utils import get_event_type_attr_type_by_keypath, get_event_type_keypaths


class CredlyOrganizationAdminForm(forms.ModelForm):
Expand Down
4 changes: 2 additions & 2 deletions credentials/apps/badges/credly/webhooks.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import logging

from django.contrib.sites.shortcuts import get_current_site
from django.shortcuts import get_object_or_404
from rest_framework import status
from rest_framework.response import Response
from rest_framework.views import APIView
from django.contrib.sites.shortcuts import get_current_site

from .api_client import CredlyAPIClient
from ..models import CredlyBadgeTemplate, CredlyOrganization
from .api_client import CredlyAPIClient


logger = logging.getLogger(__name__)
Expand Down
7 changes: 1 addition & 6 deletions credentials/apps/badges/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@
from django_extensions.db.models import TimeStampedModel
from model_utils import Choices
from model_utils.fields import StatusField
from openedx_events.learning.data import (
BadgeData,
BadgeTemplateData,
UserData,
UserPersonalData,
)
from openedx_events.learning.data import BadgeData, BadgeTemplateData, UserData, UserPersonalData

from credentials.apps.badges.credly.utils import get_credly_base_url
from credentials.apps.badges.signals.signals import (
Expand Down
3 changes: 2 additions & 1 deletion credentials/apps/badges/processing/progression.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
"""

import logging
from attrs import asdict
from typing import List

from attrs import asdict

from credentials.apps.badges.models import BadgeRequirement


Expand Down
3 changes: 2 additions & 1 deletion credentials/apps/badges/processing/regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
"""

import logging
from attrs import asdict
from typing import List

from attrs import asdict

from credentials.apps.badges.models import BadgePenalty


Expand Down
1 change: 1 addition & 0 deletions credentials/apps/badges/signals/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""

import logging

from django.dispatch import Signal
from openedx_events.learning.signals import BADGE_AWARDED, BADGE_REVOKED

Expand Down
2 changes: 1 addition & 1 deletion credentials/apps/badges/tests/test_issuers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

from credentials.apps.credentials.constants import UserCredentialStatus

from ..models import CredlyBadge, CredlyBadgeTemplate, CredlyOrganization
from ..issuers import CredlyBadgeTemplateIssuer
from ..models import CredlyBadge, CredlyBadgeTemplate, CredlyOrganization


class CredlyBadgeTemplateIssuer(TestCase):
Expand Down
2 changes: 1 addition & 1 deletion credentials/apps/badges/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.test import TestCase
from openedx_events.learning.data import BadgeData, UserData, UserPersonalData, BadgeTemplateData
from openedx_events.learning.data import BadgeData, BadgeTemplateData, UserData, UserPersonalData

from credentials.apps.badges.models import (
BadgeProgress,
Expand Down
6 changes: 1 addition & 5 deletions credentials/apps/badges/tests/test_signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase

from credentials.apps.badges.models import (
CredlyBadge,
CredlyBadgeTemplate,
CredlyOrganization,
)
from credentials.apps.badges.issuers import CredlyBadgeTemplateIssuer
from credentials.apps.badges.models import CredlyBadge, CredlyBadgeTemplate, CredlyOrganization
from credentials.apps.badges.signals.signals import BADGE_PROGRESS_COMPLETE, BADGE_PROGRESS_INCOMPLETE


Expand Down
16 changes: 8 additions & 8 deletions credentials/apps/badges/tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import unittest

from attr import asdict
from datetime import datetime
from django.conf import settings
from unittest.mock import patch

from attr import asdict
from django.conf import settings
from openedx_events.learning.data import UserData, UserPersonalData, CourseData, CoursePassingStatusData
from opaque_keys.edx.keys import CourseKey
from openedx_events.learning.data import CourseData, CoursePassingStatusData, UserData, UserPersonalData

from credentials.apps.badges.checks import badges_checks
from credentials.apps.badges.credly.utils import get_credly_base_url, get_credly_api_base_url
from credentials.apps.badges.utils import (
from credentials.apps.badges.credly.utils import get_credly_api_base_url, get_credly_base_url
from credentials.apps.badges.utils import (
credly_check,
extract_payload,
get_event_type_keypaths,
get_user_data, keypath,
get_event_type_attr_type_by_keypath,
get_event_type_keypaths,
get_user_data,
keypath,
)


COURSE_PASSING_EVENT = "org.openedx.learning.course.passing.status.updated.v1"

class TestKeypath(unittest.TestCase):
Expand Down
1 change: 1 addition & 0 deletions credentials/apps/badges/toggles.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from edx_toggles.toggles import SettingToggle


# .. toggle_name: BADGES_ENABLED
# .. toggle_implementation: DjangoSetting
# .. toggle_default: False
Expand Down
2 changes: 1 addition & 1 deletion credentials/apps/badges/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import attr
import inspect

import attr
from attrs import asdict
from django.conf import settings
from openedx_events.learning.data import UserData
Expand Down
1 change: 0 additions & 1 deletion credentials/tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import platform
import sys
import unittest

from logging.handlers import SysLogHandler
from os import path
from unittest.mock import patch
Expand Down

0 comments on commit 3366597

Please sign in to comment.