From 544c0648cbad745cdc286c24061ac93e9f927f1e Mon Sep 17 00:00:00 2001 From: Anders Schau Knatten Date: Thu, 2 Jul 2026 11:00:12 +0200 Subject: [PATCH 1/2] Bump dependencies --- requirements.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/requirements.txt b/requirements.txt index 9dbd137..0963c52 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.13 +# This file is autogenerated by pip-compile with Python 3.14 # by the following command: # # pip-compile requirements.in @@ -10,13 +10,13 @@ autopep8==2.3.2 # via -r requirements.in build==1.5.0 # via pip-tools -certifi==2026.5.20 +certifi==2026.6.17 # via requests charset-normalizer==3.4.7 # via requests clang-format==22.1.5 # via -r requirements.in -click==8.4.1 +click==8.4.2 # via pip-tools cssselect==1.4.0 # via splinter @@ -25,7 +25,7 @@ django==5.2.15 # -r requirements.in # django-reversion # splinter -django-reversion==6.2.0 +django-reversion==6.3.0 # via -r requirements.in idna==3.18 # via requests @@ -58,13 +58,13 @@ pycodestyle==2.14.0 # via autopep8 pygments==2.20.0 # via pytest -pymdown-extensions==10.21.3 +pymdown-extensions==11.0 # via -r requirements.in pyproject-hooks==1.2.0 # via # build # pip-tools -pytest==9.0.3 +pytest==9.1.1 # via # -r requirements.in # pytest-django From c7805f625397c5c7ecfcb8a0a96795ca6f9cfc94 Mon Sep 17 00:00:00 2001 From: Anders Schau Knatten Date: Thu, 2 Jul 2026 10:55:33 +0200 Subject: [PATCH 2/2] Fully stop posting to X (Twitter) We previously switched from posting new questions to X to instead post an encouragement to follow us on Bluesky/Mastodon. Our X integration has now stopped working. Let's just kill this code instead of spending time trying to fix it. Fixes #425 --- quiz/management/commands/auto_publish.py | 17 ----------------- quiz/models.py | 2 +- quiz/tests/unit/test_models.py | 2 +- requirements.in | 2 +- requirements.txt | 12 +----------- 5 files changed, 4 insertions(+), 31 deletions(-) diff --git a/quiz/management/commands/auto_publish.py b/quiz/management/commands/auto_publish.py index 869efea..e3149af 100644 --- a/quiz/management/commands/auto_publish.py +++ b/quiz/management/commands/auto_publish.py @@ -5,8 +5,6 @@ import datetime from pathlib import Path -import tweepy -from django.core.mail import mail_admins from django.core.management.base import BaseCommand from django.utils import timezone @@ -37,7 +35,6 @@ def handle(self, *args, **options): def post_to_socials(self, content): platforms = [ - ("X", self.post_to_x), ("Bluesky", lambda: self.post_to_bluesky(content)), ("Mastodon", lambda: self.post_to_mastodon(content)), ] @@ -51,20 +48,6 @@ def post_to_socials(self, content): traceback.print_exc() return had_failure - def post_to_x(self): - content = "We just published a new question! Follow us on Bluesky @cppquiz.bsky.social or Mastodon @cppquiz@mastodon.online for updates. For obvious reasons, no longer post to Elon Musk's X." - print(f"Posting to X: '{content}'") - secrets = self.read_secrets() - - client = tweepy.Client( - consumer_key=secrets["consumer_key"], consumer_secret=secrets["consumer_secret"], - access_token=secrets["access_token"], access_token_secret=secrets["access_token_secret"], - ) - response = client.create_tweet( - text=content - ) - post_url = f"https://x.com/user/status/{response.data['id']}" - def post_to_bluesky(self, content): print(f"Posting to Bluesky: '{content}'") secrets = self.read_secrets() diff --git a/quiz/models.py b/quiz/models.py index 28b3a52..5a95d37 100644 --- a/quiz/models.py +++ b/quiz/models.py @@ -76,7 +76,7 @@ def clean(self): if self.state in ('PUB', 'SCH') and self.reserved: raise ValidationError(f'Cannot {verbs[self.state]} a reserved question') if self.socials_text and not re.search("https?://", self.socials_text): - raise ValidationError('Tweets must contain a url!') + raise ValidationError('Social media messages must contain a url!') def save(self, *args, **kwargs): self.full_clean() diff --git a/quiz/tests/unit/test_models.py b/quiz/tests/unit/test_models.py index 79e8052..fbdd697 100644 --- a/quiz/tests/unit/test_models.py +++ b/quiz/tests/unit/test_models.py @@ -54,7 +54,7 @@ def test_requires_url_in_socials_text(self): q = Question(state="SCH", hint='hint', socials_text="hi", difficulty=1) with self.assertRaises(ValidationError) as cm: q.save() - self.assertIn('Tweets must contain a url!', str(cm.exception)) + self.assertIn('Social media messages must contain a url!', str(cm.exception)) Question(state="SCH", hint='hint', socials_text="See http://example.com", difficulty=1).save() Question(state="SCH", hint='hint', socials_text="See https://example.com", difficulty=1).save() diff --git a/requirements.in b/requirements.in index 109b526..78b647c 100644 --- a/requirements.in +++ b/requirements.in @@ -1,9 +1,9 @@ Django>=5,<6 Markdown +requests pymdown-extensions mock parameterized -tweepy autopep8 pip-tools pytest diff --git a/requirements.txt b/requirements.txt index 0963c52..ae37c4a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -39,10 +39,6 @@ markdown==3.10.2 # pymdown-extensions mock==5.2.0 # via -r requirements.in -oauthlib==3.3.1 - # via - # requests-oauthlib - # tweepy packaging==26.2 # via # build @@ -73,17 +69,11 @@ pytest-django==4.12.0 pyyaml==6.0.3 # via pymdown-extensions requests==2.34.2 - # via - # requests-oauthlib - # tweepy -requests-oauthlib==2.0.0 - # via tweepy + # via -r requirements.in splinter[django]==0.21.0 # via -r requirements.in sqlparse==0.5.5 # via django -tweepy==4.16.0 - # via -r requirements.in urllib3==2.7.0 # via # requests