Verified Commit 639882bd authored by Eliot Berriot's avatar Eliot Berriot
Browse files

See #297: removed unused variables

parent 2b1c4631
......@@ -41,7 +41,6 @@ class Command(BaseCommand):
script["entrypoint"](self, **options)
def show_help(self):
indentation = 4
self.stdout.write("")
self.stdout.write("Available scripts:")
self.stdout.write("Launch with: python manage.py <script_name>")
......
......@@ -40,7 +40,6 @@ class ActionSerializer(serializers.Serializer):
return value
def validate_objects(self, value):
qs = None
if value == "all":
return self.queryset.all().order_by("id")
if type(value) in [list, tuple]:
......
import os
import json
from urllib.parse import quote_plus
import youtube_dl
from django.conf import settings
import glob
def download(
......
import datetime
import logging
import uuid
import xml
from django.conf import settings
......@@ -155,7 +154,6 @@ class SystemActor(object):
return handler(data, actor)
def handle_follow(self, ac, sender):
system_actor = self.get_actor_instance()
serializer = serializers.FollowSerializer(
data=ac, context={"follow_actor": sender}
)
......@@ -325,7 +323,6 @@ class TestActor(SystemActor):
reply_url = "https://{}/activities/note/{}".format(
settings.FEDERATION_HOSTNAME, now.timestamp()
)
reply_content = "{} Pong!".format(sender.mention_username)
reply_activity = {
"@context": [
"https://www.w3.org/ns/activitystreams",
......
......@@ -687,7 +687,7 @@ class AudioSerializer(serializers.Serializer):
def validate_url(self, v):
try:
url = v["href"]
v["href"]
except (KeyError, TypeError):
raise serializers.ValidationError("Missing href")
......
......@@ -47,7 +47,7 @@ def verify_django(django_request, public_key):
v = request.headers[h]
if v:
request.headers[h] = str(v)
prepared_request = request.prepare()
request.prepare()
return verify(request, public_key)
......
......@@ -249,7 +249,7 @@ class LibraryViewSet(
def create(self, request, *args, **kwargs):
serializer = serializers.APILibraryCreateSerializer(data=request.data)
serializer.is_valid(raise_exception=True)
library = serializer.save()
serializer.save()
return response.Response(serializer.data, status=201)
......
......@@ -12,7 +12,6 @@ memo = memoize.Memoizer(store, namespace="instance:stats")
def get():
share_stats = preferences.get("instance__nodeinfo_stats_enabled")
private = preferences.get("instance__nodeinfo_private")
data = {
"version": "2.0",
"software": {"name": "funkwhale", "version": funkwhale_api.__version__},
......
import urllib.request
import html.parser
from bs4 import BeautifulSoup
......
import cacheops
import os
from django.db import transaction
from django.db.models import Q
......
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.db import migrations, models
from funkwhale_api.common.utils import rename_file
......
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.db import migrations, models
from funkwhale_api.common.utils import rename_file
......
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.db import migrations, models
from funkwhale_api.music.utils import guess_mimetype
......
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.db import migrations, models
......
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import uuid
from django.db import migrations, models
......
import os
import io
import arrow
import datetime
import tempfile
......
import ffmpeg
import os
import json
import logging
import subprocess
import unicodedata
import urllib
......
......@@ -178,7 +178,6 @@ class Command(BaseCommand):
async = options["async"]
import_handler = tasks.import_job_run.delay if async else tasks.import_job_run
batch = user.imports.create(source="shell")
total = len(paths)
errors = []
for i, path in list(enumerate(paths)):
try:
......
import acoustid
import os
import datetime
from django.core.files import File
from django.db import transaction
......
......@@ -147,7 +147,7 @@ class TagRadio(RelatedObjectRadio):
def get_queryset(self, **kwargs):
qs = super().get_queryset(**kwargs)
return Track.objects.filter(tags__in=[self.session.related_object])
return qs.filter(tags__in=[self.session.related_object])
@registry.register(name="artist")
......
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