See #297: removed unused imports
This commit is contained in:
parent
639882bd34
commit
9427f8b56e
|
@ -1,12 +1,9 @@
|
||||||
from urllib.parse import parse_qs
|
from urllib.parse import parse_qs
|
||||||
|
|
||||||
import jwt
|
|
||||||
|
|
||||||
from django.contrib.auth.models import AnonymousUser
|
from django.contrib.auth.models import AnonymousUser
|
||||||
from django.utils.encoding import smart_text
|
|
||||||
|
|
||||||
from rest_framework import exceptions
|
from rest_framework import exceptions
|
||||||
from rest_framework_jwt.settings import api_settings
|
|
||||||
from rest_framework_jwt.authentication import BaseJSONWebTokenAuthentication
|
from rest_framework_jwt.authentication import BaseJSONWebTokenAuthentication
|
||||||
|
|
||||||
from funkwhale_api.users.models import User
|
from funkwhale_api.users.models import User
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import operator
|
import operator
|
||||||
|
|
||||||
from django.conf import settings
|
|
||||||
from django.http import Http404
|
from django.http import Http404
|
||||||
|
|
||||||
from rest_framework.permissions import BasePermission
|
from rest_framework.permissions import BasePermission
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
from . import django_permissions_to_user_permissions
|
|
||||||
from . import test
|
|
|
@ -1,2 +1,3 @@
|
||||||
|
|
||||||
from .downloader import download
|
from .downloader import download
|
||||||
|
|
||||||
|
__all__ = ["download"]
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
from django.conf import settings
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
from django.conf import settings
|
|
||||||
|
|
||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
from django.conf.urls import include, url
|
|
||||||
from . import views
|
from . import views
|
||||||
|
|
||||||
from rest_framework import routers
|
from rest_framework import routers
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
from rest_framework import generics, mixins, viewsets
|
from rest_framework import mixins, viewsets
|
||||||
from rest_framework import status
|
from rest_framework import status
|
||||||
from rest_framework.response import Response
|
from rest_framework.response import Response
|
||||||
from rest_framework import pagination
|
|
||||||
from rest_framework.decorators import list_route
|
from rest_framework.decorators import list_route
|
||||||
|
|
||||||
from funkwhale_api.activity import record
|
from funkwhale_api.activity import record
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
from . import serializers
|
|
||||||
from . import tasks
|
|
||||||
|
|
||||||
ACTIVITY_TYPES = [
|
ACTIVITY_TYPES = [
|
||||||
"Accept",
|
"Accept",
|
||||||
"Add",
|
"Add",
|
||||||
|
@ -52,9 +49,13 @@ OBJECT_TYPES = [
|
||||||
|
|
||||||
|
|
||||||
def deliver(activity, on_behalf_of, to=[]):
|
def deliver(activity, on_behalf_of, to=[]):
|
||||||
|
from . import tasks
|
||||||
|
|
||||||
return tasks.send.delay(activity=activity, actor_id=on_behalf_of.pk, to=to)
|
return tasks.send.delay(activity=activity, actor_id=on_behalf_of.pk, to=to)
|
||||||
|
|
||||||
|
|
||||||
def accept_follow(follow):
|
def accept_follow(follow):
|
||||||
|
from . import serializers
|
||||||
|
|
||||||
serializer = serializers.AcceptFollowSerializer(follow)
|
serializer = serializers.AcceptFollowSerializer(follow)
|
||||||
return deliver(serializer.data, to=[follow.actor.url], on_behalf_of=follow.target)
|
return deliver(serializer.data, to=[follow.actor.url], on_behalf_of=follow.target)
|
||||||
|
|
|
@ -9,7 +9,6 @@ from django.utils import timezone
|
||||||
|
|
||||||
from rest_framework.exceptions import PermissionDenied
|
from rest_framework.exceptions import PermissionDenied
|
||||||
|
|
||||||
from dynamic_preferences.registries import global_preferences_registry
|
|
||||||
|
|
||||||
from funkwhale_api.common import preferences
|
from funkwhale_api.common import preferences
|
||||||
from funkwhale_api.common import session
|
from funkwhale_api.common import session
|
||||||
|
|
|
@ -7,8 +7,6 @@ from rest_framework import exceptions
|
||||||
|
|
||||||
from . import actors
|
from . import actors
|
||||||
from . import keys
|
from . import keys
|
||||||
from . import models
|
|
||||||
from . import serializers
|
|
||||||
from . import signing
|
from . import signing
|
||||||
from . import utils
|
from . import utils
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
from django.forms import widgets
|
|
||||||
|
|
||||||
from dynamic_preferences import types
|
from dynamic_preferences import types
|
||||||
from dynamic_preferences.registries import global_preferences_registry
|
from dynamic_preferences.registries import global_preferences_registry
|
||||||
|
|
|
@ -5,7 +5,6 @@ from cryptography.hazmat.backends import default_backend as crypto_default_backe
|
||||||
import re
|
import re
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
|
|
||||||
from . import exceptions
|
|
||||||
|
|
||||||
KEY_ID_REGEX = re.compile(r"keyId=\"(?P<id>.*)\"")
|
KEY_ID_REGEX = re.compile(r"keyId=\"(?P<id>.*)\"")
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
from django.conf import settings
|
|
||||||
|
|
||||||
from rest_framework.permissions import BasePermission
|
from rest_framework.permissions import BasePermission
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
import logging
|
import logging
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
|
|
||||||
from django.urls import reverse
|
|
||||||
from django.conf import settings
|
|
||||||
from django.core.paginator import Paginator
|
from django.core.paginator import Paginator
|
||||||
from django.db import transaction
|
from django.db import transaction
|
||||||
|
|
||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
from dynamic_preferences.registries import global_preferences_registry
|
|
||||||
|
|
||||||
from funkwhale_api.common import utils as funkwhale_utils
|
from funkwhale_api.common import utils as funkwhale_utils
|
||||||
from funkwhale_api.common import serializers as common_serializers
|
from funkwhale_api.common import serializers as common_serializers
|
||||||
|
|
|
@ -11,7 +11,6 @@ from requests.exceptions import RequestException
|
||||||
from dynamic_preferences.registries import global_preferences_registry
|
from dynamic_preferences.registries import global_preferences_registry
|
||||||
|
|
||||||
from funkwhale_api.common import session
|
from funkwhale_api.common import session
|
||||||
from funkwhale_api.history.models import Listening
|
|
||||||
from funkwhale_api.taskapp import celery
|
from funkwhale_api.taskapp import celery
|
||||||
|
|
||||||
from . import actors
|
from . import actors
|
||||||
|
|
|
@ -1,24 +1,18 @@
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.conf import settings
|
|
||||||
from django.core import paginator
|
from django.core import paginator
|
||||||
from django.db import transaction
|
from django.db import transaction
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
|
|
||||||
from rest_framework import mixins
|
from rest_framework import mixins
|
||||||
from rest_framework import permissions as rest_permissions
|
|
||||||
from rest_framework import response
|
from rest_framework import response
|
||||||
from rest_framework import views
|
|
||||||
from rest_framework import viewsets
|
from rest_framework import viewsets
|
||||||
from rest_framework.decorators import list_route, detail_route
|
from rest_framework.decorators import list_route, detail_route
|
||||||
from rest_framework.serializers import ValidationError
|
|
||||||
|
|
||||||
from funkwhale_api.common import preferences
|
from funkwhale_api.common import preferences
|
||||||
from funkwhale_api.common import utils as funkwhale_utils
|
|
||||||
from funkwhale_api.music import models as music_models
|
from funkwhale_api.music import models as music_models
|
||||||
from funkwhale_api.users.permissions import HasUserPermission
|
from funkwhale_api.users.permissions import HasUserPermission
|
||||||
|
|
||||||
from . import activity
|
|
||||||
from . import actors
|
from . import actors
|
||||||
from . import authentication
|
from . import authentication
|
||||||
from . import filters
|
from . import filters
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.urls import reverse
|
|
||||||
|
|
||||||
from funkwhale_api.common import session
|
from funkwhale_api.common import session
|
||||||
|
|
||||||
from . import actors
|
from . import actors
|
||||||
from . import utils
|
|
||||||
from . import serializers
|
from . import serializers
|
||||||
|
|
||||||
VALID_RESOURCE_TYPES = ["acct"]
|
VALID_RESOURCE_TYPES = ["acct"]
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.core.exceptions import ValidationError
|
|
||||||
|
|
||||||
from funkwhale_api.music.models import Track
|
from funkwhale_api.music.models import Track
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
from django.conf.urls import include, url
|
|
||||||
from . import views
|
from . import views
|
||||||
|
|
||||||
from rest_framework import routers
|
from rest_framework import routers
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
from rest_framework import generics, mixins, viewsets
|
from rest_framework import mixins, viewsets
|
||||||
from rest_framework import permissions
|
from rest_framework import permissions
|
||||||
from rest_framework import status
|
|
||||||
from rest_framework.response import Response
|
|
||||||
from rest_framework.decorators import detail_route
|
|
||||||
|
|
||||||
from funkwhale_api.activity import record
|
from funkwhale_api.activity import record
|
||||||
from funkwhale_api.common.permissions import ConditionalAuthentication
|
|
||||||
|
|
||||||
from . import models
|
from . import models
|
||||||
from . import serializers
|
from . import serializers
|
||||||
|
|
|
@ -9,7 +9,6 @@ from funkwhale_api.common import preferences
|
||||||
from funkwhale_api.users.permissions import HasUserPermission
|
from funkwhale_api.users.permissions import HasUserPermission
|
||||||
|
|
||||||
from . import nodeinfo
|
from . import nodeinfo
|
||||||
from . import stats
|
|
||||||
|
|
||||||
|
|
||||||
NODEINFO_2_CONTENT_TYPE = "application/json; profile=http://nodeinfo.diaspora.software/ns/schema/2.0#; charset=utf-8" # noqa
|
NODEINFO_2_CONTENT_TYPE = "application/json; profile=http://nodeinfo.diaspora.software/ns/schema/2.0#; charset=utf-8" # noqa
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
from django.db.models import Count
|
|
||||||
|
|
||||||
from django_filters import rest_framework as filters
|
from django_filters import rest_framework as filters
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ Populates the database with fake data
|
||||||
"""
|
"""
|
||||||
import random
|
import random
|
||||||
|
|
||||||
from funkwhale_api.music import models
|
|
||||||
from funkwhale_api.music import factories
|
from funkwhale_api.music import factories
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,7 @@ import cacheops
|
||||||
|
|
||||||
from django.db import transaction
|
from django.db import transaction
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
from django.conf import settings
|
from django.core.management.base import BaseCommand
|
||||||
from django.core.management.base import BaseCommand, CommandError
|
|
||||||
|
|
||||||
from funkwhale_api.music import models, utils
|
from funkwhale_api.music import models, utils
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
import taggit.managers
|
import taggit.managers
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
import django.utils.timezone
|
import django.utils.timezone
|
||||||
import versatileimagefield.fields
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
import versatileimagefield.fields
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
from funkwhale_api.common.utils import rename_file
|
|
||||||
|
|
||||||
|
|
||||||
def rename_files(apps, schema_editor):
|
def rename_files(apps, schema_editor):
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
import versatileimagefield.fields
|
import versatileimagefield.fields
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
from funkwhale_api.common.utils import rename_file
|
|
||||||
|
|
||||||
|
|
||||||
def bind_jobs(apps, schema_editor):
|
def bind_jobs(apps, schema_editor):
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
from funkwhale_api.music.utils import guess_mimetype
|
from funkwhale_api.music.utils import guess_mimetype
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
def populate_status(apps, schema_editor):
|
def populate_status(apps, schema_editor):
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
from django.conf import settings
|
|
||||||
|
|
||||||
from rest_framework.permissions import BasePermission
|
from rest_framework.permissions import BasePermission
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,8 @@
|
||||||
from django.db import transaction
|
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
from taggit.models import Tag
|
from taggit.models import Tag
|
||||||
|
|
||||||
from funkwhale_api.activity import serializers as activity_serializers
|
from funkwhale_api.activity import serializers as activity_serializers
|
||||||
from funkwhale_api.federation import utils as federation_utils
|
|
||||||
from funkwhale_api.federation.models import LibraryTrack
|
|
||||||
from funkwhale_api.federation.serializers import AP_CONTEXT
|
|
||||||
from funkwhale_api.users.serializers import UserBasicSerializer
|
from funkwhale_api.users.serializers import UserBasicSerializer
|
||||||
|
|
||||||
from . import models
|
from . import models
|
||||||
|
|
|
@ -8,7 +8,6 @@ from musicbrainzngs import ResponseError
|
||||||
from funkwhale_api.common import preferences
|
from funkwhale_api.common import preferences
|
||||||
from funkwhale_api.federation import activity
|
from funkwhale_api.federation import activity
|
||||||
from funkwhale_api.federation import actors
|
from funkwhale_api.federation import actors
|
||||||
from funkwhale_api.federation import models as federation_models
|
|
||||||
from funkwhale_api.federation import serializers as federation_serializers
|
from funkwhale_api.federation import serializers as federation_serializers
|
||||||
from funkwhale_api.taskapp import celery
|
from funkwhale_api.taskapp import celery
|
||||||
from funkwhale_api.providers.acoustid import get_acoustid_client
|
from funkwhale_api.providers.acoustid import get_acoustid_client
|
||||||
|
|
|
@ -1,32 +1,24 @@
|
||||||
import ffmpeg
|
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import unicodedata
|
|
||||||
import urllib
|
import urllib
|
||||||
|
|
||||||
from django.contrib.auth.decorators import login_required
|
|
||||||
from django.core.exceptions import ObjectDoesNotExist
|
from django.core.exceptions import ObjectDoesNotExist
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import models, transaction
|
from django.db import models, transaction
|
||||||
from django.db.models.functions import Length
|
from django.db.models.functions import Length
|
||||||
from django.db.models import Count
|
from django.db.models import Count
|
||||||
from django.http import StreamingHttpResponse
|
|
||||||
from django.urls import reverse
|
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from django.utils.decorators import method_decorator
|
|
||||||
|
|
||||||
from rest_framework import viewsets, views, mixins
|
from rest_framework import viewsets, views, mixins
|
||||||
from rest_framework.decorators import detail_route, list_route
|
from rest_framework.decorators import detail_route, list_route
|
||||||
from rest_framework.response import Response
|
from rest_framework.response import Response
|
||||||
from rest_framework import settings as rest_settings
|
from rest_framework import settings as rest_settings
|
||||||
from rest_framework import permissions
|
|
||||||
from musicbrainzngs import ResponseError
|
from musicbrainzngs import ResponseError
|
||||||
|
|
||||||
from funkwhale_api.common import utils as funkwhale_utils
|
from funkwhale_api.common import utils as funkwhale_utils
|
||||||
from funkwhale_api.common.permissions import ConditionalAuthentication
|
from funkwhale_api.common.permissions import ConditionalAuthentication
|
||||||
from funkwhale_api.users.permissions import HasUserPermission
|
from funkwhale_api.users.permissions import HasUserPermission
|
||||||
from taggit.models import Tag
|
from taggit.models import Tag
|
||||||
from funkwhale_api.federation import actors
|
|
||||||
from funkwhale_api.federation.authentication import SignatureAuthentication
|
from funkwhale_api.federation.authentication import SignatureAuthentication
|
||||||
from funkwhale_api.federation.models import LibraryTrack
|
from funkwhale_api.federation.models import LibraryTrack
|
||||||
from funkwhale_api.musicbrainz import api
|
from funkwhale_api.musicbrainz import api
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
from .client import api
|
from .client import api
|
||||||
|
|
||||||
|
__all__ = ["api"]
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from django.conf.urls import include, url
|
from django.conf.urls import url
|
||||||
from rest_framework import routers
|
from rest_framework import routers
|
||||||
|
|
||||||
from . import views
|
from . import views
|
||||||
|
|
|
@ -2,7 +2,6 @@ from rest_framework import viewsets
|
||||||
from rest_framework.views import APIView
|
from rest_framework.views import APIView
|
||||||
from rest_framework.response import Response
|
from rest_framework.response import Response
|
||||||
from rest_framework.decorators import list_route
|
from rest_framework.decorators import list_route
|
||||||
import musicbrainzngs
|
|
||||||
|
|
||||||
from funkwhale_api.common.permissions import ConditionalAuthentication
|
from funkwhale_api.common.permissions import ConditionalAuthentication
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
from django.conf import settings
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.db import transaction
|
from django.db import transaction
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
from django.conf import settings
|
|
||||||
from django.db import transaction
|
from django.db import transaction
|
||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
from taggit.models import Tag
|
|
||||||
|
|
||||||
from funkwhale_api.common import preferences
|
from funkwhale_api.common import preferences
|
||||||
from funkwhale_api.music.models import Track
|
from funkwhale_api.music.models import Track
|
||||||
|
|
|
@ -2,15 +2,13 @@ from django.db.models import Count
|
||||||
from django.db import transaction
|
from django.db import transaction
|
||||||
|
|
||||||
from rest_framework import exceptions
|
from rest_framework import exceptions
|
||||||
from rest_framework import generics, mixins, viewsets
|
from rest_framework import mixins, viewsets
|
||||||
from rest_framework import status
|
|
||||||
from rest_framework.decorators import detail_route
|
from rest_framework.decorators import detail_route
|
||||||
from rest_framework.response import Response
|
from rest_framework.response import Response
|
||||||
from rest_framework.permissions import IsAuthenticatedOrReadOnly
|
from rest_framework.permissions import IsAuthenticatedOrReadOnly
|
||||||
|
|
||||||
from funkwhale_api.common import permissions
|
from funkwhale_api.common import permissions
|
||||||
from funkwhale_api.common import fields
|
from funkwhale_api.common import fields
|
||||||
from funkwhale_api.music.models import Track
|
|
||||||
|
|
||||||
from . import filters
|
from . import filters
|
||||||
from . import models
|
from . import models
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
from django.conf.urls import include, url
|
from django.conf.urls import include, url
|
||||||
from funkwhale_api.music import views
|
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(
|
url(
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
from apiclient.discovery import build
|
from apiclient.discovery import build
|
||||||
from apiclient.errors import HttpError
|
|
||||||
from oauth2client.tools import argparser
|
|
||||||
|
|
||||||
from dynamic_preferences.registries import global_preferences_registry as registry
|
from dynamic_preferences.registries import global_preferences_registry as registry
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from django.conf.urls import include, url
|
from django.conf.urls import url
|
||||||
from .views import APISearch, APISearchs
|
from .views import APISearch, APISearchs
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
from .registries import registry
|
|
|
@ -7,7 +7,6 @@ from django.urls import reverse_lazy
|
||||||
import persisting_theory
|
import persisting_theory
|
||||||
|
|
||||||
from funkwhale_api.music import models
|
from funkwhale_api.music import models
|
||||||
from funkwhale_api.taskapp.celery import require_instance
|
|
||||||
|
|
||||||
|
|
||||||
class RadioFilterRegistry(persisting_theory.Registry):
|
class RadioFilterRegistry(persisting_theory.Registry):
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from django.core.exceptions import ValidationError
|
|
||||||
from django.contrib.postgres.fields import JSONField
|
from django.contrib.postgres.fields import JSONField
|
||||||
from django.contrib.contenttypes.fields import GenericForeignKey
|
from django.contrib.contenttypes.fields import GenericForeignKey
|
||||||
from django.contrib.contenttypes.models import ContentType
|
from django.contrib.contenttypes.models import ContentType
|
||||||
|
@ -77,7 +76,6 @@ class RadioSession(models.Model):
|
||||||
@property
|
@property
|
||||||
def radio(self):
|
def radio(self):
|
||||||
from .registries import registry
|
from .registries import registry
|
||||||
from . import radios
|
|
||||||
|
|
||||||
return registry[self.radio_type](session=self)
|
return registry[self.radio_type](session=self)
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
from django.conf.urls import include, url
|
|
||||||
from . import views
|
from . import views
|
||||||
|
|
||||||
from rest_framework import routers
|
from rest_framework import routers
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
from django.http import Http404
|
from django.http import Http404
|
||||||
|
|
||||||
from rest_framework import generics, mixins, viewsets
|
from rest_framework import mixins, viewsets
|
||||||
from rest_framework import permissions
|
from rest_framework import permissions
|
||||||
from rest_framework import status
|
from rest_framework import status
|
||||||
from rest_framework.response import Response
|
from rest_framework.response import Response
|
||||||
from rest_framework.decorators import detail_route, list_route
|
from rest_framework.decorators import detail_route, list_route
|
||||||
|
|
||||||
from funkwhale_api.music.serializers import TrackSerializer
|
from funkwhale_api.music.serializers import TrackSerializer
|
||||||
from funkwhale_api.common.permissions import ConditionalAuthentication
|
|
||||||
|
|
||||||
from . import models
|
from . import models
|
||||||
from . import filters
|
from . import filters
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
from django.conf.urls import include, url
|
|
||||||
from . import views
|
from . import views
|
||||||
|
|
||||||
from rest_framework import routers
|
from rest_framework import routers
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
from rest_framework import generics, mixins, viewsets
|
from rest_framework import mixins, viewsets
|
||||||
from rest_framework import status
|
|
||||||
from rest_framework.response import Response
|
|
||||||
from rest_framework.decorators import detail_route
|
|
||||||
|
|
||||||
from . import filters
|
from . import filters
|
||||||
from . import models
|
from . import models
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
from dynamic_preferences import types
|
from dynamic_preferences import types
|
||||||
from dynamic_preferences.registries import global_preferences_registry
|
from dynamic_preferences.registries import global_preferences_registry
|
||||||
|
|
||||||
from funkwhale_api.common import preferences
|
|
||||||
|
|
||||||
subsonic = types.Section("subsonic")
|
subsonic = types.Section("subsonic")
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ import os
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.contrib.auth.models import AbstractUser, Permission
|
from django.contrib.auth.models import AbstractUser
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.utils.encoding import python_2_unicode_compatible
|
from django.utils.encoding import python_2_unicode_compatible
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import pytest
|
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
|
|
|
@ -17,7 +17,6 @@ from rest_framework.test import APIRequestFactory
|
||||||
|
|
||||||
from funkwhale_api.activity import record
|
from funkwhale_api.activity import record
|
||||||
from funkwhale_api.users.permissions import HasUserPermission
|
from funkwhale_api.users.permissions import HasUserPermission
|
||||||
from funkwhale_api.taskapp import celery
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session", autouse=True)
|
@pytest.fixture(scope="session", autouse=True)
|
||||||
|
|
|
@ -2,7 +2,6 @@ import json
|
||||||
import pytest
|
import pytest
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
|
|
||||||
from funkwhale_api.music.models import Track, Artist
|
|
||||||
from funkwhale_api.favorites.models import TrackFavorite
|
from funkwhale_api.favorites.models import TrackFavorite
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,6 @@ from django.utils import timezone
|
||||||
|
|
||||||
from rest_framework import exceptions
|
from rest_framework import exceptions
|
||||||
|
|
||||||
from funkwhale_api.federation import activity
|
|
||||||
from funkwhale_api.federation import actors
|
from funkwhale_api.federation import actors
|
||||||
from funkwhale_api.federation import models
|
from funkwhale_api.federation import models
|
||||||
from funkwhale_api.federation import serializers
|
from funkwhale_api.federation import serializers
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
from funkwhale_api.federation import authentication
|
from funkwhale_api.federation import authentication
|
||||||
from funkwhale_api.federation import keys
|
from funkwhale_api.federation import keys
|
||||||
from funkwhale_api.federation import signing
|
|
||||||
|
|
||||||
|
|
||||||
def test_authenticate(factories, mocker, api_request):
|
def test_authenticate(factories, mocker, api_request):
|
||||||
|
|
|
@ -2,8 +2,6 @@ import pytest
|
||||||
|
|
||||||
from django import db
|
from django import db
|
||||||
|
|
||||||
from funkwhale_api.federation import models
|
|
||||||
from funkwhale_api.federation import serializers
|
|
||||||
|
|
||||||
|
|
||||||
def test_cannot_duplicate_actor(factories):
|
def test_cannot_duplicate_actor(factories):
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
import arrow
|
import arrow
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from django.urls import reverse
|
|
||||||
from django.core.paginator import Paginator
|
from django.core.paginator import Paginator
|
||||||
|
|
||||||
from funkwhale_api.federation import actors
|
from funkwhale_api.federation import actors
|
||||||
from funkwhale_api.federation import keys
|
|
||||||
from funkwhale_api.federation import models
|
from funkwhale_api.federation import models
|
||||||
from funkwhale_api.federation import serializers
|
from funkwhale_api.federation import serializers
|
||||||
from funkwhale_api.federation import utils
|
from funkwhale_api.federation import utils
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import cryptography.exceptions
|
import cryptography.exceptions
|
||||||
import pytest
|
import pytest
|
||||||
import requests_http_signature
|
|
||||||
|
|
||||||
from funkwhale_api.federation import signing
|
from funkwhale_api.federation import signing
|
||||||
from funkwhale_api.federation import keys
|
from funkwhale_api.federation import keys
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import datetime
|
import datetime
|
||||||
import os
|
import os
|
||||||
import pathlib
|
import pathlib
|
||||||
import pytest
|
|
||||||
|
|
||||||
from django.core.paginator import Paginator
|
from django.core.paginator import Paginator
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.urls import reverse
|
|
||||||
|
|
||||||
from funkwhale_api.federation import webfinger
|
from funkwhale_api.federation import webfinger
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from django.core.exceptions import ValidationError
|
|
||||||
from django.utils import timezone
|
|
||||||
|
|
||||||
from funkwhale_api.history import models
|
from funkwhale_api.history import models
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
from django.urls import reverse
|
|
||||||
|
|
||||||
import funkwhale_api
|
import funkwhale_api
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@ import pytest
|
||||||
|
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
|
|
||||||
from dynamic_preferences.api import serializers
|
|
||||||
|
|
||||||
|
|
||||||
def test_can_list_settings_via_api(preferences, api_client):
|
def test_can_list_settings_via_api(preferences, api_client):
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
from django.urls import reverse
|
|
||||||
|
|
||||||
from funkwhale_api.instance import stats
|
from funkwhale_api.instance import stats
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
from funkwhale_api.users.serializers import UserActivitySerializer
|
|
||||||
from funkwhale_api.favorites import serializers
|
|
||||||
|
|
||||||
|
|
||||||
def test_get_track_activity_url_mbid(factories):
|
def test_get_track_activity_url_mbid(factories):
|
||||||
|
|
|
@ -4,8 +4,6 @@ import pytest
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
|
|
||||||
from funkwhale_api.music import models
|
from funkwhale_api.music import models
|
||||||
from funkwhale_api.musicbrainz import api
|
|
||||||
from funkwhale_api.music import serializers
|
|
||||||
from funkwhale_api.music import tasks
|
from funkwhale_api.music import tasks
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import pytest
|
|
||||||
|
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
|
|
||||||
from funkwhale_api.music import models
|
from funkwhale_api.music import models
|
||||||
from funkwhale_api.musicbrainz import api
|
|
||||||
from funkwhale_api.music import serializers
|
|
||||||
from funkwhale_api.music import tasks
|
from funkwhale_api.music import tasks
|
||||||
from funkwhale_api.music import lyrics as lyrics_utils
|
from funkwhale_api.music import lyrics as lyrics_utils
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import os
|
import os
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from funkwhale_api.providers.acoustid import get_acoustid_client
|
|
||||||
from funkwhale_api.music import tasks
|
from funkwhale_api.music import tasks
|
||||||
|
|
||||||
DATA_DIR = os.path.dirname(os.path.abspath(__file__))
|
DATA_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
from django.urls import reverse
|
|
||||||
|
|
||||||
from funkwhale_api.music import models
|
from funkwhale_api.music import models
|
||||||
from funkwhale_api.musicbrainz import api
|
|
||||||
from funkwhale_api.music import serializers
|
|
||||||
|
|
||||||
|
|
||||||
def test_can_import_work(factories, mocker, works):
|
def test_can_import_work(factories, mocker, works):
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
|
|
||||||
from funkwhale_api.musicbrainz import api
|
|
||||||
|
|
||||||
|
|
||||||
def test_can_search_recording_in_musicbrainz_api(
|
def test_can_search_recording_in_musicbrainz_api(
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from django.core.exceptions import ValidationError
|
|
||||||
from django.utils import timezone
|
|
||||||
|
|
||||||
from funkwhale_api.playlists import models
|
from funkwhale_api.playlists import models
|
||||||
from funkwhale_api.playlists import serializers
|
from funkwhale_api.playlists import serializers
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import json
|
import json
|
||||||
import pytest
|
|
||||||
|
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import pytest
|
|
||||||
|
|
||||||
from django.forms import ValidationError
|
|
||||||
|
|
||||||
|
|
||||||
def test_can_bind_import_batch_to_request(factories):
|
def test_can_bind_import_batch_to_request(factories):
|
||||||
|
|
|
@ -6,7 +6,6 @@ from django.core.management import call_command
|
||||||
from django.core.management.base import CommandError
|
from django.core.management.base import CommandError
|
||||||
|
|
||||||
from funkwhale_api.providers.audiofile import tasks
|
from funkwhale_api.providers.audiofile import tasks
|
||||||
from funkwhale_api.music import tasks as music_tasks
|
|
||||||
|
|
||||||
DATA_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "files")
|
DATA_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "files")
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ import pytest
|
||||||
from jwt.exceptions import DecodeError
|
from jwt.exceptions import DecodeError
|
||||||
from rest_framework_jwt.settings import api_settings
|
from rest_framework_jwt.settings import api_settings
|
||||||
|
|
||||||
from funkwhale_api.users.models import User
|
|
||||||
|
|
||||||
|
|
||||||
def test_can_invalidate_token_when_changing_user_secret_key(factories):
|
def test_can_invalidate_token_when_changing_user_secret_key(factories):
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from django.test import RequestFactory
|
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
|
|
||||||
from funkwhale_api.users.models import User
|
from funkwhale_api.users.models import User
|
||||||
|
|
Loading…
Reference in New Issue