fix delete
This commit is contained in:
1 parent
c7b09b30bd
commit
800a8dca90
1 file changed
+3
-1
@@ -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