chore: format files using isort (pre-commit)
This commit is contained in:
parent
20ed5f0d52
commit
cff619679b
226 changed files with 483 additions and 735 deletions
|
|
@ -2,11 +2,12 @@
|
|||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from django import forms
|
||||
from funkwhale_api.common import admin
|
||||
from django.contrib.auth.admin import UserAdmin as AuthUserAdmin
|
||||
from django.contrib.auth.forms import UserChangeForm, UserCreationForm
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from funkwhale_api.common import admin
|
||||
|
||||
from . import models
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
from django.conf.urls import url
|
||||
|
||||
from funkwhale_api.common import routers
|
||||
|
||||
from . import views
|
||||
|
||||
router = routers.OptionalSlashRouter()
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
from django.contrib.auth import backends, get_user_model
|
||||
from allauth.account import auth_backends
|
||||
from django.contrib.auth import backends, get_user_model
|
||||
|
||||
from funkwhale_api.common import authentication
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,10 @@
|
|||
from django.conf import settings
|
||||
from django.core import signing
|
||||
|
||||
from rest_framework import authentication
|
||||
from rest_framework import exceptions
|
||||
from django.core.exceptions import ValidationError
|
||||
|
||||
from .oauth import scopes as available_scopes
|
||||
from rest_framework import authentication, exceptions
|
||||
|
||||
from . import models
|
||||
from .oauth import scopes as available_scopes
|
||||
|
||||
|
||||
def generate_scoped_token(user_id, user_secret, scopes):
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
import pytz
|
||||
import factory
|
||||
import pytz
|
||||
from django.contrib.auth.models import Permission
|
||||
from django.utils import timezone
|
||||
from funkwhale_api.factories import ManyToManyFromList, registry, NoUpdateOnCreate
|
||||
|
||||
from funkwhale_api.factories import ManyToManyFromList, NoUpdateOnCreate, registry
|
||||
|
||||
from . import models
|
||||
|
||||
|
|
|
|||
|
|
@ -8,14 +8,14 @@ import string
|
|||
import uuid
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import AbstractUser, UserManager as BaseUserManager
|
||||
from django.db.models import JSONField
|
||||
from django.contrib.auth.models import AbstractUser
|
||||
from django.contrib.auth.models import UserManager as BaseUserManager
|
||||
from django.db import models, transaction
|
||||
from django.db.models import JSONField
|
||||
from django.dispatch import receiver
|
||||
from django.urls import reverse
|
||||
from django.utils import timezone
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from django_auth_ldap.backend import populate_user as ldap_populate_user
|
||||
from oauth2_provider import models as oauth2_models
|
||||
from oauth2_provider import validators as oauth2_validators
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@ import uuid
|
|||
|
||||
from django.db import transaction
|
||||
|
||||
from funkwhale_api.common import mutations
|
||||
from funkwhale_api.common import utils
|
||||
from funkwhale_api.common import mutations, utils
|
||||
from funkwhale_api.federation import models
|
||||
|
||||
from . import tasks
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
from rest_framework import permissions
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from rest_framework import permissions
|
||||
|
||||
from funkwhale_api.common import preferences
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import urllib.parse
|
||||
|
||||
import oauthlib.oauth2
|
||||
|
||||
from funkwhale_api.common import authentication
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from funkwhale_api.taskapp import celery
|
||||
|
||||
from oauth2_provider import models as oauth2_models
|
||||
|
||||
from funkwhale_api.taskapp import celery
|
||||
|
||||
|
||||
@celery.app.task(name="oauth.clear_expired_tokens")
|
||||
def clear_expired_tokens():
|
||||
|
|
|
|||
|
|
@ -1,25 +1,22 @@
|
|||
import json
|
||||
import urllib.parse
|
||||
import secrets
|
||||
import urllib.parse
|
||||
|
||||
from django import http
|
||||
from django.utils import timezone
|
||||
from django.db.models import Q
|
||||
|
||||
from rest_framework import mixins, permissions, response, views, viewsets
|
||||
from rest_framework.decorators import action
|
||||
|
||||
from django.utils import timezone
|
||||
from drf_spectacular.utils import extend_schema
|
||||
|
||||
from oauth2_provider import exceptions as oauth2_exceptions
|
||||
from oauth2_provider import views as oauth_views
|
||||
from oauth2_provider.settings import oauth2_settings
|
||||
from rest_framework import mixins, permissions, response, views, viewsets
|
||||
from rest_framework.decorators import action
|
||||
|
||||
from funkwhale_api.common import throttling
|
||||
|
||||
from .. import models
|
||||
from .permissions import ScopePermission
|
||||
from . import serializers
|
||||
from .permissions import ScopePermission
|
||||
|
||||
|
||||
class ApplicationViewSet(
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from dj_rest_auth import views as rest_auth_views
|
||||
from django.conf.urls import url
|
||||
from django.views.generic import TemplateView
|
||||
from dj_rest_auth import views as rest_auth_views
|
||||
|
||||
from . import views
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +1,16 @@
|
|||
import re
|
||||
|
||||
from allauth.account import models as allauth_models
|
||||
from dj_rest_auth.registration.serializers import RegisterSerializer as RS
|
||||
from dj_rest_auth.registration.serializers import get_adapter
|
||||
from dj_rest_auth.serializers import PasswordResetSerializer as PRS
|
||||
from django.contrib import auth
|
||||
from django.contrib.auth.forms import PasswordResetForm
|
||||
from django.core import validators
|
||||
from django.utils.deconstruct import deconstructible
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.contrib.auth.forms import PasswordResetForm
|
||||
|
||||
from django.contrib import auth
|
||||
|
||||
from allauth.account import models as allauth_models
|
||||
from dj_rest_auth.serializers import PasswordResetSerializer as PRS
|
||||
from dj_rest_auth.registration.serializers import RegisterSerializer as RS, get_adapter
|
||||
from drf_spectacular.types import OpenApiTypes
|
||||
from drf_spectacular.utils import extend_schema_field
|
||||
from rest_framework import serializers
|
||||
|
||||
from funkwhale_api.activity import serializers as activity_serializers
|
||||
|
|
@ -22,12 +23,9 @@ from funkwhale_api.moderation import models as moderation_models
|
|||
from funkwhale_api.moderation import tasks as moderation_tasks
|
||||
from funkwhale_api.moderation import utils as moderation_utils
|
||||
|
||||
from drf_spectacular.utils import extend_schema_field
|
||||
from drf_spectacular.types import OpenApiTypes
|
||||
|
||||
from . import adapters
|
||||
from . import models
|
||||
from . import authentication as users_authentication
|
||||
from . import models
|
||||
|
||||
|
||||
@deconstructible
|
||||
|
|
|
|||
|
|
@ -1,22 +1,17 @@
|
|||
import json
|
||||
|
||||
from django import http
|
||||
from django.contrib import auth
|
||||
from django.middleware import csrf
|
||||
|
||||
from allauth.account.adapter import get_adapter
|
||||
from dj_rest_auth import views as rest_auth_views
|
||||
from dj_rest_auth.registration import views as registration_views
|
||||
from rest_framework import mixins
|
||||
from rest_framework import viewsets
|
||||
from django import http
|
||||
from django.contrib import auth
|
||||
from django.middleware import csrf
|
||||
from drf_spectacular.utils import extend_schema, extend_schema_view
|
||||
from rest_framework import mixins, viewsets
|
||||
from rest_framework.decorators import action
|
||||
from rest_framework.response import Response
|
||||
|
||||
from drf_spectacular.utils import extend_schema, extend_schema_view
|
||||
|
||||
from funkwhale_api.common import authentication
|
||||
from funkwhale_api.common import preferences
|
||||
from funkwhale_api.common import throttling
|
||||
from funkwhale_api.common import authentication, preferences, throttling
|
||||
|
||||
from . import models, serializers, tasks
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue