mirror of
https://github.com/tanrax/org-social-relay
synced 2026-07-25 10:45:00 +02:00
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.
25 lines
679 B
Python
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),
|
|
]
|