1
0
Fork 0
mirror of https://gitlab.com/SIGBUS/nyaa.git synced 2024-12-22 20:19:59 +00:00

Don't generate empty torrent file for torrents without info dict (has_torrent).

This commit is contained in:
A nyaa developer 2017-05-22 20:08:41 +02:00 committed by GitHub
parent 607d9b2c92
commit b241dd5508

View file

@ -679,7 +679,7 @@ def redirect_magnet(torrent_id):
def download_torrent(torrent_id):
torrent = models.Torrent.by_id(torrent_id)
if not torrent:
if not torrent or not torrent.has_torrent:
flask.abort(404)
resp = flask.Response(_get_cached_torrent_file(torrent))