Skip to content

Commit

Permalink
Revert all === comparison with db models;
Browse files Browse the repository at this point in the history
  • Loading branch information
jerone committed Dec 2, 2014
1 parent a9668ad commit 59a68a0
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions controllers/scriptStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ exports.storeScript = function (aUser, aMeta, aBuf, aCallback, aUpdate) {
if (!scriptName) { return aCallback(null); }

if (!isLibrary && aMeta.oujs && aMeta.oujs.author
&& aMeta.oujs.author !== aUser.name && aMeta.oujs.collaborator) {
&& aMeta.oujs.author != aUser.name && aMeta.oujs.collaborator) {
collaborators = aMeta.oujs.collaborator;
if ((typeof collaborators === 'string'
&& collaborators === aUser.name)
Expand Down Expand Up @@ -327,8 +327,8 @@ exports.storeScript = function (aUser, aMeta, aBuf, aCallback, aUpdate) {
} else {
// Script already exists.
if (!aScript.isLib) {
if (collaborators && (aScript.meta.oujs && aScript.meta.oujs.author !== aMeta.oujs.author
|| (aScript.meta.oujs && JSON.stringify(aScript.meta.oujs.collaborator) !==
if (collaborators && (aScript.meta.oujs && aScript.meta.oujs.author != aMeta.oujs.author
|| (aScript.meta.oujs && JSON.stringify(aScript.meta.oujs.collaborator) !=
JSON.stringify(aMeta.oujs.collaborator)))) {
return aCallback(null);
}
Expand Down
2 changes: 1 addition & 1 deletion controllers/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -1371,7 +1371,7 @@ function getExistingScript(aReq, aOptions, aAuthedUser, aCallback) {
aOptions.source = Buffer.concat(bufs).toString('utf8');
aOptions.original = aScript.installName;
aOptions.url = aReq.url;
aOptions.owner = aAuthedUser && (aScript._authorId === aAuthedUser._id
aOptions.owner = aAuthedUser && (aScript._authorId == aAuthedUser._id
|| collaborators.indexOf(aAuthedUser.name) > -1);
aOptions.username = aAuthedUser ? aAuthedUser.name : null;
aOptions.isLib = aScript.isLib;
Expand Down
2 changes: 1 addition & 1 deletion libs/flag.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function flaggable(aModel, aContent, aUser, aCallback) {
// to police the site administration
if (aModel.modelName === 'User') {
return getFlag(aModel, aContent, aUser, function (aFlag) {
aCallback(aContent._id !== aUser._id && aContent.role > 2, aContent, aFlag);
aCallback(aContent._id != aUser._id && aContent.role > 2, aContent, aFlag);
});
}

Expand Down
2 changes: 1 addition & 1 deletion libs/modelParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ var parseDiscussion = function (aDiscussionData) {
var recentCommentors = [];
if (discussion.author)
recentCommentors.push(discussion.author);
if (discussion.lastCommentor !== discussion.author)
if (discussion.lastCommentor != discussion.author)
recentCommentors.push(discussion.lastCommentor);
recentCommentors = _.map(recentCommentors, function (aUsername) {
return {
Expand Down
2 changes: 1 addition & 1 deletion libs/remove.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function removeable(aModel, aContent, aUser, aCallback) {
// You can't remove yourself
// You can only remove a remove a user with a lesser role than yourself
if (aModel.modelName === 'User') {
return aCallback(aContent._id !== aUser._id && aContent.role > aUser.role,
return aCallback(aContent._id != aUser._id && aContent.role > aUser.role,
aContent);
}

Expand Down

0 comments on commit 59a68a0

Please sign in to comment.