mirror of
https://github.com/ProjectSynthoria/SynthoriaArchive.git
synced 2025-03-12 23:36:54 +02:00
Redundant query
This commit is contained in:
parent
ec0f8000d7
commit
04c9ef6685
2 changed files with 2 additions and 6 deletions
|
@ -422,11 +422,7 @@ class Report(db.Model):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def not_reviewed(cls, page):
|
def not_reviewed(cls, page):
|
||||||
reports = cls.query.filter(cls.status == 0)\
|
reports = cls.query.filter_by(status=0).paginate(page=page, per_page=20)
|
||||||
.join(Torrent, aliased=True).filter(Torrent.flags != 36, Torrent.flags != 2)\
|
|
||||||
.order_by(db.asc(cls.id))\
|
|
||||||
.paginate(page=page, per_page=20)
|
|
||||||
# reports = cls.query.filter_by(status=0).paginate(page=page, per_page=20)
|
|
||||||
return reports
|
return reports
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
|
@ -701,7 +701,7 @@ def view_reports():
|
||||||
report_id = report_action.report.data
|
report_id = report_action.report.data
|
||||||
torrent = models.Torrent.by_id(torrent_id)
|
torrent = models.Torrent.by_id(torrent_id)
|
||||||
report = models.Report.by_id(report_id)
|
report = models.Report.by_id(report_id)
|
||||||
|
|
||||||
if not torrent or not report or report.status != 0:
|
if not torrent or not report or report.status != 0:
|
||||||
flask.abort(404)
|
flask.abort(404)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Reference in a new issue