diff --git a/.github/workflows/lint-frontend.yaml b/.github/workflows/lint-frontend.yaml index b0322f371..68142b946 100644 --- a/.github/workflows/lint-frontend.yaml +++ b/.github/workflows/lint-frontend.yaml @@ -15,7 +15,7 @@ on: jobs: lint: name: Lint with stylelint and ESLint. - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it. diff --git a/.github/workflows/prettier.yaml b/.github/workflows/prettier.yaml index 9c05c7476..df56cafb0 100644 --- a/.github/workflows/prettier.yaml +++ b/.github/workflows/prettier.yaml @@ -10,7 +10,7 @@ on: jobs: lint: name: Lint with Prettier - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it. diff --git a/bookwyrm/connectors/inventaire.py b/bookwyrm/connectors/inventaire.py index 249f6b9ca..69524b222 100644 --- a/bookwyrm/connectors/inventaire.py +++ b/bookwyrm/connectors/inventaire.py @@ -222,9 +222,10 @@ class Connector(AbstractConnector): def get_description(self, links: JsonDict) -> str: """grab an extracted excerpt from wikipedia""" link = links.get("enwiki") - if not link: + if not link or not link.get("title"): return "" - url = f"{self.base_url}/api/data?action=wp-extract&lang=en&title={link}" + title = link.get("title") + url = f"{self.base_url}/api/data?action=wp-extract&lang=en&title={title}" try: data = get_data(url) except ConnectorException: diff --git a/bookwyrm/forms/landing.py b/bookwyrm/forms/landing.py index 831d1d539..4f5b3223f 100644 --- a/bookwyrm/forms/landing.py +++ b/bookwyrm/forms/landing.py @@ -64,6 +64,10 @@ class InviteRequestForm(CustomForm): if email and models.User.objects.filter(email=email).exists(): self.add_error("email", _("A user with this email already exists.")) + email_domain = email.split("@")[-1] + if email and models.EmailBlocklist.objects.filter(domain=email_domain).exists(): + self.add_error("email", _("This email address cannot be registered.")) + class Meta: model = models.InviteRequest fields = ["email", "answer"] diff --git a/bookwyrm/tests/connectors/test_inventaire_connector.py b/bookwyrm/tests/connectors/test_inventaire_connector.py index 7844f3919..1cd88195f 100644 --- a/bookwyrm/tests/connectors/test_inventaire_connector.py +++ b/bookwyrm/tests/connectors/test_inventaire_connector.py @@ -273,7 +273,9 @@ class Inventaire(TestCase): json={"extract": "hi hi"}, ) - extract = self.connector.get_description({"enwiki": "test_path"}) + extract = self.connector.get_description( + {"enwiki": {"title": "test_path", "badges": "hello"}} + ) self.assertEqual(extract, "hi hi") def test_remote_id_from_model(self): diff --git a/requirements.txt b/requirements.txt index f6018a652..bf338efe7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ boto3==1.34.74 bw-file-resubmit==0.6.0rc2 celery==5.3.6 colorthief==0.2.1 -Django==4.2.16 +Django==4.2.18 django-celery-beat==2.6.0 django-compressor==4.4 django-csp==3.8