mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2024-12-22 09:30:01 +00:00
Remove duplicate reports for already reviewed torrent
This commit is contained in:
parent
354736720b
commit
73c84ce5ec
|
@ -429,6 +429,10 @@ class Report(db.Model):
|
|||
# reports = cls.query.filter_by(status=0).paginate(page=page, per_page=20)
|
||||
return reports
|
||||
|
||||
@classmethod
|
||||
def remove_reviewed(cls, id):
|
||||
return cls.query.filter(cls.torrent_id == id, cls.status == 0).delete()
|
||||
|
||||
# class Session(db.Model):
|
||||
# __tablename__ = 'sessions'
|
||||
#
|
||||
|
|
|
@ -710,6 +710,7 @@ def view_reports():
|
|||
else:
|
||||
report.status = 2
|
||||
|
||||
models.Report.remove_reviewed(data['torrent'])
|
||||
db.session.commit()
|
||||
flask.flash('Closed report #{}'.format(report.id), 'success')
|
||||
return flask.redirect(flask.url_for('view_reports'))
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
soon{% endif %}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
<div class="panel-footer" style="font-size: large">
|
||||
{% if torrent.has_torrent %}
|
||||
<a href="/view/{{ torrent.id }}/torrent"><i class="fa fa-download fa-fw"></i>Download Torrent</a>
|
||||
or {% endif %}<a href="{{ torrent.magnet_uri }}" class="card-footer-item"><i
|
||||
|
|
Loading…
Reference in a new issue