Skip to content
Snippets Groups Projects
Verified Commit 9bea804f authored by Eliot Berriot's avatar Eliot Berriot
Browse files

See #297: sorted imports

parent 9427f8b5
No related branches found
No related tags found
No related merge requests found
Showing
with 28 additions and 60 deletions
......@@ -4,8 +4,7 @@ from rest_framework.response import Response
from funkwhale_api.common.permissions import ConditionalAuthentication
from funkwhale_api.favorites.models import TrackFavorite
from . import serializers
from . import utils
from . import serializers, utils
class ActivityViewSet(viewsets.GenericViewSet):
......
from urllib.parse import parse_qs
from django.contrib.auth.models import AnonymousUser
from rest_framework import exceptions
from rest_framework_jwt.authentication import BaseJSONWebTokenAuthentication
......
from django.utils.encoding import smart_text
from django.utils.translation import ugettext as _
from rest_framework import exceptions
from rest_framework_jwt import authentication
from rest_framework_jwt.settings import api_settings
......
from channels.generic.websocket import JsonWebsocketConsumer
from funkwhale_api.common import channels
......
import django_filters
from django.db import models
from funkwhale_api.music import utils
PRIVACY_LEVEL_CHOICES = [
("me", "Only me"),
("followers", "Me and my followers"),
......
import operator
from django.http import Http404
from rest_framework.permissions import BasePermission
from funkwhale_api.common import preferences
......
from django.conf import settings
from django import forms
from dynamic_preferences import serializers
from dynamic_preferences import types
from django.conf import settings
from dynamic_preferences import serializers, types
from dynamic_preferences.registries import global_preferences_registry
......
......@@ -2,10 +2,10 @@
Convert django permissions to user permissions in the database,
following the work done in #152.
"""
from django.contrib.auth.models import Permission
from django.db.models import Q
from funkwhale_api.users import models
from django.contrib.auth.models import Permission
from funkwhale_api.users import models
mapping = {
"dynamic_preferences.change_globalpreferencemodel": "settings",
......
import requests
from django.conf import settings
import funkwhale_api
......
from urllib.parse import urlencode, parse_qs, urlsplit, urlunsplit
import os
import shutil
from urllib.parse import parse_qs, urlencode, urlsplit, urlunsplit
from django.db import transaction
......
import os
import youtube_dl
from django.conf import settings
......
from funkwhale_api.common import channels
from funkwhale_api.activity import record
from funkwhale_api.common import channels
from . import serializers
......
import factory
from funkwhale_api.factories import registry
from funkwhale_api.music.factories import TrackFactory
from funkwhale_api.users.factories import UserFactory
......
from . import views
from rest_framework import routers
from . import views
router = routers.SimpleRouter()
router.register(r"tracks", views.TrackFavoriteViewSet, "tracks")
......
from rest_framework import mixins, viewsets
from rest_framework import status
from rest_framework.response import Response
from rest_framework import mixins, status, viewsets
from rest_framework.decorators import list_route
from rest_framework.response import Response
from funkwhale_api.activity import record
from funkwhale_api.music.models import Track
from funkwhale_api.common.permissions import ConditionalAuthentication
from funkwhale_api.music.models import Track
from . import models
from . import serializers
from . import models, serializers
class TrackFavoriteViewSet(
......
......@@ -6,22 +6,14 @@ from django.conf import settings
from django.db import transaction
from django.urls import reverse
from django.utils import timezone
from rest_framework.exceptions import PermissionDenied
from funkwhale_api.common import preferences
from funkwhale_api.common import session
from funkwhale_api.common import preferences, session
from funkwhale_api.common import utils as funkwhale_utils
from funkwhale_api.music import models as music_models
from funkwhale_api.music import tasks as music_tasks
from . import activity
from . import keys
from . import models
from . import serializers
from . import signing
from . import utils
from . import activity, keys, models, serializers, signing, utils
logger = logging.getLogger(__name__)
......
import cryptography
from django.contrib.auth.models import AnonymousUser
from rest_framework import authentication, exceptions
from rest_framework import authentication
from rest_framework import exceptions
from . import actors
from . import keys
from . import signing
from . import utils
from . import actors, keys, signing, utils
class SignatureAuthentication(authentication.BaseAuthentication):
......
import uuid
import factory
import requests
import requests_http_signature
import uuid
from django.utils import timezone
from django.conf import settings
from django.utils import timezone
from funkwhale_api.factories import registry
from . import keys
from . import models
from . import keys, models
registry.register(keys.get_key_pair, name="federation.KeyPair")
......
from cryptography.hazmat.primitives import serialization as crypto_serialization
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.backends import default_backend as crypto_default_backend
import re
import urllib.parse
from cryptography.hazmat.backends import default_backend as crypto_default_backend
from cryptography.hazmat.primitives import serialization as crypto_serialization
from cryptography.hazmat.primitives.asymmetric import rsa
KEY_ID_REGEX = re.compile(r"keyId=\"(?P<id>.*)\"")
......
import json
import requests
import requests
from django.conf import settings
from funkwhale_api.common import session
from . import actors
from . import models
from . import serializers
from . import signing
from . import webfinger
from . import actors, models, serializers, signing, webfinger
def scan_from_account_name(account_name):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment