Verified Commit 9427f8b5 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

See #297: removed unused imports

parent 639882bd
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
......
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
......
from . import django_permissions_to_user_permissions
from . import test
from .downloader import download from .downloader import download
__all__ = ["download"]
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
......
from django.conf import settings
from rest_framework import serializers from rest_framework import serializers
......
from django.conf.urls import include, url
from . import views from . import views
from rest_framework import routers from rest_framework import routers
......
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
......
from . import serializers
from . import tasks
ACTIVITY_TYPES = [ ACTIVITY_TYPES = [
"Accept", "Accept",
"Add", "Add",
...@@ -52,9 +49,13 @@ OBJECT_TYPES = [ ...@@ -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 ...@@ -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 ...@@ -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
......
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 ...@@ -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>.*)\"")
......
from django.conf import settings
from rest_framework.permissions import BasePermission from rest_framework.permissions import BasePermission
......
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 ...@@ -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
......
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
......
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"]
......
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
......
from django.conf.urls import include, url
from . import views from . import views
from rest_framework import routers from rest_framework import routers
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment