Skip to content

Commit a0ac028

Browse files
authored
Allow spam as reason for moderating user (#8635)
1 parent 4a171bc commit a0ac028

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

app/lib/account/models.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class User extends db.ExpandoModel<String> {
7979
InvalidInputException.checkAnyOf(
8080
moderatedReason,
8181
'reason',
82-
UserModeratedReason._values,
82+
UserModeratedReason.values,
8383
);
8484
} else {
8585
InvalidInputException.checkNull(moderatedReason, 'reason');
@@ -416,13 +416,15 @@ abstract class UserModeratedReason {
416416
static const bot = 'bot';
417417
static const illegalContent = 'illegal-content';
418418
static const policyViolation = 'policy-violation';
419+
static const spam = 'spam';
419420
static const unfoundedNotifications = 'unfounded-notifications';
420421
static const unfoundedAppeals = 'unfounded-appeals';
421422

422-
static const _values = {
423+
static const values = {
423424
bot,
424425
illegalContent,
425426
policyViolation,
427+
spam,
426428
unfoundedNotifications,
427429
unfoundedAppeals,
428430
};

app/lib/admin/actions/moderate_user.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ The active web sessions of the user will be expired.
3030
'case':
3131
'The ModerationCase.caseId that this action is part of (or `none`).',
3232
'user': 'The user-id or the email of the user to be moderated',
33-
'reason': 'The reason for user moderation.',
33+
'reason':
34+
'The reason for user moderation. One of ${UserModeratedReason.values.join(', ')}.',
3435
'state':
3536
'Set moderated state true / false. Returns current state if omitted.',
3637
'note': 'Optional note to store (internal).'

0 commit comments

Comments
 (0)