fix delete

This commit is contained in:
2025-09-06 12:01:56 +02:00
parent c7b09b30bd
commit 800a8dca90

View File

@@ -32,7 +32,9 @@ def update_transmission_data():
def clean_old_torrents():
expired_date = timezone.now() - timedelta(days=settings.TORRENT_TTL)
Torrent.objects.filter(date_created__lt=expired_date).first().delete()
torrent = Torrent.objects.filter(date_created__lt=expired_date).first()
if torrent:
torrent.delete()
class Command(BaseCommand):