Files
andros c446ae514d Exclude bridge virtual feeds from feed listing, discovery and stats
Bridges help users connect to external content (RSS, ActivityPub) but
are not real Org Social accounts. They no longer appear in /feeds/,
cannot be registered via POST, are skipped by both feed discovery
tasks, and do not count in /stats/. A data migration removes bridge
URLs already registered as feeds.
2026-07-20 09:33:28 +02:00

25 lines
679 B
Python

from django.db import migrations
from django.db.models import Q
def delete_bridge_feeds(apps, schema_editor):
"""
Bridge virtual feeds are a connection helper, not real accounts.
Remove any that were registered before they were excluded from
registration and discovery.
"""
Feed = apps.get_model("feeds", "Feed")
Feed.objects.filter(
Q(url__contains="/bridge/activitypub/") | Q(url__contains="/bridge/rss/")
).delete()
class Migration(migrations.Migration):
dependencies = [
("feeds", "0011_outgoingwebmention"),
]
operations = [
migrations.RunPython(delete_bridge_feeds, migrations.RunPython.noop),
]