fix for #552
This commit is contained in:
parent
2a92d87b52
commit
f05abfcb9a
1 changed files with 13 additions and 3 deletions
|
@ -222,9 +222,19 @@ export function projectForUserExists(username, projectId, callback) {
|
|||
callback(false);
|
||||
return;
|
||||
}
|
||||
Project.findById(projectId, (innerErr, project) => (
|
||||
(project && project.user.equals(user._id)) ? callback(true) : callback(false)
|
||||
));
|
||||
Project.findOne({_id: projectId, user: user._id}, (innerErr, project) => {
|
||||
if (project) {
|
||||
callback(true);
|
||||
return;
|
||||
}
|
||||
Project.findOne({slug: projectId, user: user._id}, (slugError, projectBySlug) => {
|
||||
if (projectBySlug) {
|
||||
callback(true);
|
||||
return;
|
||||
}
|
||||
callback(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue