fix mastodon post encoding
This commit is contained in:
parent
3086d63cc7
commit
27a4b1a094
3 changed files with 92 additions and 8 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue