mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-29 07:53:27 -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 users reporter ON reports.reporterId = reporter.id
|
||||||
LEFT JOIN profiles p on sus.id = p.userId
|
LEFT JOIN profiles p on sus.id = p.userId
|
||||||
WHERE reports.id > ${cutoff}
|
WHERE reports.id > ${cutoff}
|
||||||
|
AND sus.username IS NOT NULL
|
||||||
GROUP BY reports.id
|
GROUP BY reports.id
|
||||||
ORDER BY min(reports.isHandled) ASC, reports.id DESC
|
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,
|
users: (await db.get(`SELECT count(*) AS c FROM users`)).c,
|
||||||
data: {
|
data: {
|
||||||
admins: (await db.get(`SELECT count(*) AS c FROM users WHERE roles!=''`)).c,
|
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,
|
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'],
|
heartbeat: heartbeat['https://pronouns.page'],
|
||||||
plausible: await checkPlausible('https://pronouns.page'),
|
plausible: await checkPlausible('https://pronouns.page'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user