Skip to content

Commit

Permalink
Force lowercase in groups (#1579)
Browse files Browse the repository at this point in the history
NOTES:
* DB migration will occur in a while to merge existing. This will probably be done by hand to ensure integrity.
* `modelParser` doesn't pass the Script._id so suggested alternative is being skipped atm. Match with USO casing.

Applies to #421 

Auto-merge
  • Loading branch information
Martii authored Feb 5, 2019
1 parent dd4de48 commit 69e99bc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions controllers/group.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ var orderDir = require('../libs/templateHelpers').orderDir;
// clean the name of the group so it is url safe
function cleanGroupName(aName) {
return cleanFilename(aName, '').replace(/_/g, ' ')
.replace(/^\s+|\s+$/g, '').replace(/,/g, '');
.replace(/^\s+|\s+$/g, '').replace(/,/g, '')
.toLowerCase();
}

// api for the client side javascript select2 library
Expand Down Expand Up @@ -259,7 +260,7 @@ exports.view = function (aReq, aRes, aNext) {
var groupname = aReq.params.groupname;

// Strip out underscores for display
var groupName = groupname.replace(/_+/g, ' ');
var groupName = groupname.replace(/_+/g, ' ').toLowerCase();

Group.findOne({
name: groupName
Expand Down

0 comments on commit 69e99bc

Please sign in to comment.