Skip to content

Commit

Permalink
fix bug that prevents loading a private task (#646)
Browse files Browse the repository at this point in the history
  • Loading branch information
Niklas Kiefer authored and adrianjost committed Apr 20, 2018
1 parent e17dcc4 commit dd66b19
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controllers/homework.js
Original file line number Diff line number Diff line change
Expand Up @@ -795,8 +795,8 @@ router.get('/:assignmentId', function(req, res, next) {
})[0];

courseGroups = permissionHelper.userHasPermission(res.locals.currentUser, 'COURSE_EDIT') ?
(courseGroups.data || {}) || [] :
((courseGroups.data || {}) || []).filter(cg => cg.userIds.some(user => user._id === res.locals.currentUser._id))
((courseGroups || {}).data || {}) || [] :
(((courseGroups || {}).data || {}) || []).filter(cg => cg.userIds.some(user => user._id === res.locals.currentUser._id))
.filter(cg => cg.userIds.length <= assignment.maxTeamMembers); // filter to big courseGroups
const courseGroupSelected = ((assignment.submission || {}).courseGroupId || {})._id;

Expand Down

0 comments on commit dd66b19

Please sign in to comment.