diff --git a/app/interface/forms.py b/app/interface/forms.py index 872a4de..002e136 100644 --- a/app/interface/forms.py +++ b/app/interface/forms.py @@ -1,6 +1,6 @@ from django import forms from crispy_forms.helper import FormHelper -from crispy_forms.layout import Submit, HTML, Div +from crispy_forms.layout import Submit, HTML from crispy_bulma.layout import FormGroup from . import models, fields diff --git a/app/interface/models.py b/app/interface/models.py index dbf3fe4..86e1622 100644 --- a/app/interface/models.py +++ b/app/interface/models.py @@ -8,9 +8,7 @@ from byostorage.user import BYOStorage import random -from urllib.parse import urlparse -import os.path from .utils import sign_data MEDIA_TYPES = [ diff --git a/app/interface/tests/test_access.py b/app/interface/tests/test_access.py index 05d1c9f..96c4861 100644 --- a/app/interface/tests/test_access.py +++ b/app/interface/tests/test_access.py @@ -1,7 +1,5 @@ -from django.test import TestCase, Client -from interface import models, utils -from django.contrib.auth.models import User +from interface import models from . import AccessTestCase diff --git a/app/library/indexer/whoosh.py b/app/library/indexer/whoosh.py index f654354..fad6cd7 100644 --- a/app/library/indexer/whoosh.py +++ b/app/library/indexer/whoosh.py @@ -1,15 +1,13 @@ from whoosh.index import create_in, open_dir, EmptyIndexError, Index from whoosh.analysis import StemmingAnalyzer, CharsetFilter from whoosh.support.charset import accent_map -from whoosh.fields import Schema, ID, TEXT, KEYWORD, STORED, NUMERIC +from whoosh.fields import Schema, TEXT, KEYWORD, NUMERIC from whoosh.qparser import QueryParser from whoosh.query import Term, NullQuery -from library.models import Work from typing import Any from django.conf import settings -from django.db.models import QuerySet import os.path import shutil diff --git a/app/library/management/commands/import_works.py b/app/library/management/commands/import_works.py index 1a9ba17..00c0b63 100644 --- a/app/library/management/commands/import_works.py +++ b/app/library/management/commands/import_works.py @@ -1,4 +1,4 @@ -from django.core.management.base import BaseCommand, CommandError +from django.core.management.base import BaseCommand import argparse import csv diff --git a/app/library/management/commands/index.py b/app/library/management/commands/index.py index 07f90b8..4657152 100644 --- a/app/library/management/commands/index.py +++ b/app/library/management/commands/index.py @@ -1,4 +1,4 @@ -from django.core.management.base import BaseCommand, CommandError +from django.core.management.base import BaseCommand from library import models from library.indexer import model_search, index_works, indexer diff --git a/app/library/models.py b/app/library/models.py index a819dfa..a757d81 100644 --- a/app/library/models.py +++ b/app/library/models.py @@ -1,11 +1,9 @@ -from os import SCHED_OTHER -from django.conf import settings from django.shortcuts import resolve_url from django.db import models from django.utils.text import slugify from django.utils.timezone import now from django.utils.functional import cached_property -from django.db.models import Q, Count, Min, Max +from django.db.models import Count, Min, Max import re import os.path @@ -365,7 +363,7 @@ class Work(models.Model): def unassigned_instruments(self): assigned = set(self.assigned_instruments()) - return [x for x in self.orchestration.as_list() if not x[0] in assigned] + return [x for x in self.orchestration.as_list() if x[0] not in assigned] def music_tags(self): tags = dict(self.orchestration.as_list()) diff --git a/app/library/tests.py b/app/library/tests.py index 0b8246c..065b4ac 100644 --- a/app/library/tests.py +++ b/app/library/tests.py @@ -2,7 +2,6 @@ from interface.tests import AccessTestCase from byostorage.user import UserStorage from . import models -from .views.api import WorkSerializer import tempfile import json diff --git a/app/library/urls.py b/app/library/urls.py index 3f8ee47..e13d6ff 100644 --- a/app/library/urls.py +++ b/app/library/urls.py @@ -1,6 +1,4 @@ -from django.urls import path, include -from django.contrib.auth import views as auth_views -from rest_framework import routers +from django.urls import path from . import views diff --git a/app/library/views/api.py b/app/library/views/api.py index 84805c8..475288d 100644 --- a/app/library/views/api.py +++ b/app/library/views/api.py @@ -35,14 +35,13 @@ class WorkExportView(EnsembleMixin, WorkMixin, View): from interface.views import AuthorizedResourceMixin -from rest_framework import routers, serializers, viewsets +from rest_framework import serializers from rest_framework.exceptions import APIException from library.models import Collection, Work, Document, Section, WorkMeta import requests -from io import BytesIO import urllib import shutil import os.path