fix delete
This commit is contained in:
@@ -32,7 +32,9 @@ def update_transmission_data():
|
|||||||
|
|
||||||
def clean_old_torrents():
|
def clean_old_torrents():
|
||||||
expired_date = timezone.now() - timedelta(days=settings.TORRENT_TTL)
|
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):
|
class Command(BaseCommand):
|
||||||
|
|||||||
Reference in New Issue
Block a user