- restart container if it goes down
- connect to correct mastodon account!
- add check for `content` when parsing feeds
This commit is contained in:
Hugh Rundle 2024-01-27 11:26:05 +11:00
parent a79b771e6c
commit 6d6f1ad787
Signed by: hugh
GPG key ID: A7E35779918253F9
3 changed files with 13 additions and 3 deletions

View file

@ -129,6 +129,11 @@ class Command(BaseCommand):
and len(article.summary) and len(article.summary)
) )
else html.strip_tags(article.content[0].value)[:200] else html.strip_tags(article.content[0].value)[:200]
if (
hasattr(article, "content")
and len(article.content)
)
else None
) )
description += "..." description += "..."
@ -197,8 +202,12 @@ class Command(BaseCommand):
hasattr(edition, "description") hasattr(edition, "description")
and len(edition.summary) and len(edition.summary)
) )
else html.strip_tags(edition.content[0].value)[:200] else html.strip_tags(edition.content[0].value)[:200] + "..."
+ "..." if (
hasattr(article, "content")
and len(article.content)
)
else None
) )
description += "..." description += "..."

View file

@ -127,7 +127,7 @@ def get_webfinger_subscribe_uri(username):
template = link["template"] template = link["template"]
if user_id and template: if user_id and template:
encoded_user = iri_to_uri("blogs@ausglam.space") encoded_user = iri_to_uri("ausglamr@ausglam.space")
uri = template.replace("{uri}", encoded_user) uri = template.replace("{uri}", encoded_user)
return uri return uri

View file

@ -11,6 +11,7 @@ services:
web: web:
build: . build: .
env_file: .env env_file: .env
restart: unless-stopped
command: python manage.py runserver 0.0.0.0:8000 # only use in dev command: python manage.py runserver 0.0.0.0:8000 # only use in dev
# command: gunicorn --env DJANGO_SETTINGS_MODULE=ausglamr.settings ausglamr.wsgi --workers=10 --threads=4 -b 0.0.0.0:8000 # command: gunicorn --env DJANGO_SETTINGS_MODULE=ausglamr.settings ausglamr.wsgi --workers=10 --threads=4 -b 0.0.0.0:8000
volumes: volumes: