Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BC-6352 - Deleting the creator field causes the files not to be displayed anymore #3396

Merged
merged 9 commits into from
Mar 8, 2024
4 changes: 2 additions & 2 deletions controllers/homework.js
Original file line number Diff line number Diff line change
Expand Up @@ -595,11 +595,11 @@ router.get('/:assignmentId', (req, res, next) => {
}

const submissionFilesStorageData = _.clone(filesStorage);
submissionFilesStorageData.files = filesStorage.files.filter((file) => submitters.has(file.creatorId));
submissionFilesStorageData.files = filesStorage.files.filter((file) => !file.creatorId || submitters.has(file.creatorId));
submissionFilesStorageData.readonly = readonly || (!isCreator && isTeacher);

const gradeFilesStorageData = _.clone(filesStorage);
gradeFilesStorageData.files = filesStorage.files.filter((file) => teachers.has(file.creatorId));
gradeFilesStorageData.files = filesStorage.files.filter((file) => !file.creatorId || teachers.has(file.creatorId));
gradeFilesStorageData.readonly = !isTeacher;

submission.submissionFiles = { filesStorage: submissionFilesStorageData };
Expand Down
Loading