def get_report(cls, translation, author, reporter):
"""
Get a report by page, language, group, author, and reporter
:param translation: the translation (page, group, language) to which the report corresponds
:param author: the author to query
:param reporter: the reporting user to query
:return:
"""
if translation and author and reporter:
try:
return cls.query.filter(
cls.page_id == translation.page_id,
cls.language_id == translation.language_id,
cls.group_id == translation.group_id,
cls.author_id == author.id,
cls.reporter_id == reporter.id).one()
except exc.NoResultFound:
return None
return None
评论列表
文章目录