mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-27 06:52:35 -04:00
[admin][bug] don't count abuse reports for removed accounts
This commit is contained in:
parent
65c2f68f7f
commit
6bc43d8178
@ -407,6 +407,7 @@ router.get('/admin/reports', handleErrorAsync(async (req, res) => {
|
||||
LEFT JOIN users reporter ON reports.reporterId = reporter.id
|
||||
LEFT JOIN profiles p on sus.id = p.userId
|
||||
WHERE reports.id > ${cutoff}
|
||||
AND sus.username IS NOT NULL
|
||||
GROUP BY reports.id
|
||||
ORDER BY min(reports.isHandled) ASC, reports.id DESC
|
||||
`));
|
||||
|
@ -152,7 +152,9 @@ module.exports.calculateStats = async (db, allLocales, projectDir) => {
|
||||
users: (await db.get(`SELECT count(*) AS c FROM users`)).c,
|
||||
data: {
|
||||
admins: (await db.get(`SELECT count(*) AS c FROM users WHERE roles!=''`)).c,
|
||||
userReports: (await db.get(`SELECT count(*) AS c FROM reports WHERE isHandled = 0`)).c,
|
||||
userReports: (await db.get(`SELECT count(*) AS c FROM reports
|
||||
LEFT JOIN users sus ON reports.userId = sus.id
|
||||
WHERE isHandled = 0 AND sus.username IS NOT NULL`)).c,
|
||||
bansPending: (await db.get(`SELECT count(*) AS c FROM ban_proposals p LEFT JOIN users u ON p.userId = u.id WHERE u.bannedBy IS NULL`)).c,
|
||||
heartbeat: heartbeat['https://pronouns.page'],
|
||||
plausible: await checkPlausible('https://pronouns.page'),
|
||||
|
Loading…
x
Reference in New Issue
Block a user