if notify:
await report._send_opening_notification()
+ # Fetch the reporter
+ reporter = self.backend.users.get_by_uid(report.reported_by)
+
+ # Has this report been filed by a trusted reporter?
+ if reporter and reporter.is_trusted():
+ # Automatically close any reports from trusted reporters
+ await report.close(
+ closed_by = reporter,
+ accept = True,
+ notify = notify,
+ )
+
return report
async def notify(self):
# Close!
- async def close(self, closed_by=None, accept=True, update_stats=True):
+ async def close(self, closed_by=None, accept=True, notify=True, update_stats=True):
"""
Called when a moderator has made a decision
"""
self.accepted = accept
# Send a message to the reporter?
- await self._send_closing_notification()
+ if notify:
+ await self._send_closing_notification()
# We are done if the report has not been accepted
if not self.accepted: