diff --git a/.pylintrc b/.pylintrc index 7f92d0168..464638853 100644 --- a/.pylintrc +++ b/.pylintrc @@ -3,4 +3,7 @@ ignore=migrations load-plugins=pylint.extensions.no_self_use [MESSAGES CONTROL] -disable=E1101,E1135,E1136,R0903,R0901,R0902,W0707,W0511,W0406,R0401,R0801,C3001 +disable=E1101,E1135,E1136,R0903,R0901,R0902,W0707,W0511,W0406,R0401,R0801,C3001,import-error + +[FORMAT] +max-line-length=88 diff --git a/bookwyrm/importers/calibre_import.py b/bookwyrm/importers/calibre_import.py index 7395e2f7b..5426e9333 100644 --- a/bookwyrm/importers/calibre_import.py +++ b/bookwyrm/importers/calibre_import.py @@ -24,5 +24,5 @@ class CalibreImporter(Importer): super().__init__(*args, **kwargs) def get_shelf(self, normalized_row): - # Calibre export does not indicate which shelf to use. Go with a default one for now + # Calibre export does not indicate which shelf to use. Use a default one for now return Shelf.TO_READ diff --git a/bookwyrm/templates/settings/federation/instance_filters.html b/bookwyrm/templates/settings/federation/instance_filters.html index 46ae0c1cf..d6af7e91f 100644 --- a/bookwyrm/templates/settings/federation/instance_filters.html +++ b/bookwyrm/templates/settings/federation/instance_filters.html @@ -2,6 +2,7 @@ {% block filter_fields %} {% include 'settings/federation/software_filter.html' %} +{% include 'settings/users/server_filter.html' %} {% endblock %} diff --git a/bookwyrm/tests/test_postgres.py b/bookwyrm/tests/test_postgres.py index 624512575..94a8090f4 100644 --- a/bookwyrm/tests/test_postgres.py +++ b/bookwyrm/tests/test_postgres.py @@ -34,6 +34,7 @@ class PostgresTriggers(TestCase): ) book.authors.add(author) book.refresh_from_db() + # pylint: disable=line-too-long self.assertEqual( book.search_vector, "'cool':5B 'goodby':3A 'long':2A 'name':9 'rays':7C 'seri':8 'the':6C 'wow':4B", diff --git a/bookwyrm/utils/isni.py b/bookwyrm/utils/isni.py index 180c5e388..ea0364e55 100644 --- a/bookwyrm/utils/isni.py +++ b/bookwyrm/utils/isni.py @@ -106,7 +106,7 @@ def find_authors_by_name(name_string, description=False): if titles: # some of the "titles" in ISNI are a little ...iffy - # '@' is used by ISNI/OCLC to index the starting point ignoring stop words + # @ is used by ISNI/OCLC to index the starting point ignoring stop words # (e.g. "The @Government of no one") title_elements = [ e diff --git a/bookwyrm/views/admin/federation.py b/bookwyrm/views/admin/federation.py index cb05b779e..88bd43aac 100644 --- a/bookwyrm/views/admin/federation.py +++ b/bookwyrm/views/admin/federation.py @@ -29,6 +29,8 @@ class Federation(View): filters = {} if software := request.GET.get("application_type"): filters["application_type"] = software + if server := request.GET.get("server"): + filters["server_name"] = server servers = models.FederatedServer.objects.filter(status=status, **filters) @@ -60,7 +62,9 @@ class Federation(View): "sort": sort, "software_options": models.FederatedServer.objects.values_list( "application_type", flat=True - ).distinct(), + ) + .distinct() + .order_by("application_type"), "form": forms.ServerForm(), } return TemplateResponse(request, "settings/federation/instance_list.html", data) diff --git a/bookwyrm/views/admin/user_admin.py b/bookwyrm/views/admin/user_admin.py index df716d2cb..f1bb87a88 100644 --- a/bookwyrm/views/admin/user_admin.py +++ b/bookwyrm/views/admin/user_admin.py @@ -22,19 +22,16 @@ class UserAdminList(View): def get(self, request, status="local"): """list of users""" filters = {} - server = request.GET.get("server") - if server: + if server := request.GET.get("server"): server = models.FederatedServer.objects.filter(server_name=server).first() filters["federated_server"] = server filters["federated_server__isnull"] = False - username = request.GET.get("username") - if username: + if username := request.GET.get("username"): filters["username__icontains"] = username scope = request.GET.get("scope") if scope and scope == "local": filters["local"] = True - email = request.GET.get("email") - if email: + if email := request.GET.get("email"): filters["email__endswith"] = email filters["local"] = status == "local" diff --git a/docker-compose.yml b/docker-compose.yml index c5ff1f21b..c654374b9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -89,7 +89,7 @@ services: command: celery -A celerywyrm flower --basic_auth=${FLOWER_USER}:${FLOWER_PASSWORD} env_file: .env ports: - - ${FLOWER_PORT} + - ${FLOWER_PORT}:${FLOWER_PORT} volumes: - .:/app networks: