fix: #7748, if reputation system is disabled, dont check min reputation

This commit is contained in:
Barış Soner Uşaklı
2019-07-11 09:54:46 -04:00
parent 8ef75be3e3
commit 7b95ebbb6a
3 changed files with 8 additions and 8 deletions

View File

@@ -265,7 +265,7 @@ Flags.validate = function (payload, callback) {
}
// Check if reporter meets rep threshold (or can edit the target post, in which case threshold does not apply)
if (!editable.flag && data.reporter.reputation < meta.config['min:rep:flag']) {
if (!editable.flag && !meta.config['reputation:disabled'] && data.reporter.reputation < meta.config['min:rep:flag']) {
return callback(new Error('[[error:not-enough-reputation-to-flag]]'));
}
@@ -280,7 +280,7 @@ Flags.validate = function (payload, callback) {
}
// Check if reporter meets rep threshold (or can edit the target user, in which case threshold does not apply)
if (!editable && data.reporter.reputation < meta.config['min:rep:flag']) {
if (!editable && !meta.config['reputation:disabled'] && data.reporter.reputation < meta.config['min:rep:flag']) {
return callback(new Error('[[error:not-enough-reputation-to-flag]]'));
}