fix delete
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user