View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/500 Closes #451 Approved-by: Ember <acomputerdog@gmail.com> Approved-by: Marie <marie@kaifa.ch>
This commit is contained in:
commit
ed91663672
1 changed files with 5 additions and 2 deletions
|
@ -4,7 +4,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable, Inject } from '@nestjs/common';
|
import { Injectable, Inject } from '@nestjs/common';
|
||||||
import { Not, IsNull, DataSource } from 'typeorm';
|
import { Not, IsNull, Like, DataSource } from 'typeorm';
|
||||||
import type { MiUser } from '@/models/User.js';
|
import type { MiUser } from '@/models/User.js';
|
||||||
import { AppLockService } from '@/core/AppLockService.js';
|
import { AppLockService } from '@/core/AppLockService.js';
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
|
@ -37,7 +37,10 @@ export default class UsersChart extends Chart<typeof schema> { // eslint-disable
|
||||||
|
|
||||||
protected async tickMajor(): Promise<Partial<KVs<typeof schema>>> {
|
protected async tickMajor(): Promise<Partial<KVs<typeof schema>>> {
|
||||||
const [localCount, remoteCount] = await Promise.all([
|
const [localCount, remoteCount] = await Promise.all([
|
||||||
this.usersRepository.countBy({ host: IsNull() }),
|
// that Not(Like()) is ugly, but it matches the logic in
|
||||||
|
// packages/backend/src/models/User.ts to not count "system"
|
||||||
|
// accounts
|
||||||
|
this.usersRepository.countBy({ host: IsNull(), username: Not(Like('%.%')) }),
|
||||||
this.usersRepository.countBy({ host: Not(IsNull()) }),
|
this.usersRepository.countBy({ host: Not(IsNull()) }),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue