add subsites

This commit is contained in:
Jonas Heinrich 2025-05-08 11:48:40 +02:00
parent aa8d467b1a
commit eee8494001
12 changed files with 321 additions and 99 deletions

View file

@ -21,15 +21,19 @@ def post_to_mastodon(text):
def send_mastodon_toot_update(sender, instance, created, **kwargs):
if created and instance.public:
transaction.on_commit(lambda: post_to_mastodon(
f"Neue Entwicklung im Verwaltungsvorhaben: {instance.plan.title}!\n\n"
f"📢 Neue Entwicklung im Verwaltungsvorhaben: {instance.plan.title}!\n"
f"{instance.title}: {strip_html_tags(instance.content)}\n\n"
f"Mehr Informationen: {instance.plan.reference} #karlsruhe"
f"🔗 Primärquelle: {instance.plan.reference}\n"
f"📋 Verwaltungstracker-Eintrag: {instance.plan.get_absolute_domain_url()}\n"
f"#karlsruhe"
))
@receiver(post_save, sender=GovernmentPlan)
def send_mastodon_toot_plan(sender, instance, created, **kwargs):
if created and instance.public:
transaction.on_commit(lambda: post_to_mastodon(
f"Neues Verwaltungsvorhaben '{instance.title}' wurde aufgenommen.\n\n"
f"Mehr Informationen: {instance.reference} #karlsruhe"
f"📢 Neues Verwaltungsvorhaben '{instance.title}' wurde aufgenommen.\n\n"
f"🔗 Primärquelle: {instance.reference}\n"
f"📋 Verwaltungstracker-Eintrag: {instance.get_absolute_domain_url()}\n"
f"#karlsruhe"
))