fix mastodon post encoding

This commit is contained in:
Jonas Heinrich 2025-05-10 12:57:43 +02:00
parent 3086d63cc7
commit 27a4b1a094
3 changed files with 92 additions and 8 deletions

View file

@ -7,9 +7,8 @@ from .models import GovernmentPlanUpdate, GovernmentPlan
import re
def strip_html_tags(text):
text = text.decode('utf-8')
tag_re = re.compile(r'<[^>]+>')
return tag_re.sub('', text)
return tag_re.sub('', text).decode('utf-8')
def post_to_mastodon(text):
mastodon = Mastodon(