Skip to content

Node.js based forum software built for the modern web

fix: #8155, don't validate name on update if groupName didn't change

Barış Soner Uşaklı03a02e5d1dc9
diff --git a/src/groups/update.js b/src/groups/update.js
index c7c0996557..7c5a3720e8 100644
--- a/src/groups/update.js
+++ b/src/groups/update.js
@@ -128,7 +128,6 @@ module.exports = function (Groups) {
}
async function checkNameChange(currentName, newName) {
- Groups.validateGroupName(newName);
if (Groups.isPrivilegeGroup(newName)) {
throw new Error('[[error:invalid-group-name]]');
}
@@ -137,6 +136,7 @@ module.exports = function (Groups) {
if (currentName === newName || currentSlug === newSlug) {
return;
}
+ Groups.validateGroupName(newName);
const [group, exists] = await Promise.all([
Groups.getGroupData(currentName),
Groups.existsBySlug(newSlug),