Skip to content

Commit be97e17

Browse files
franswelFrans Welin
and
Frans Welin
authoredOct 4, 2024··
fix an issue in release_feedback where groupshared user could not re-release feedback (#1667)
Co-authored-by: Frans Welin <frans.welin@aalto.fi>
1 parent b786ea6 commit be97e17

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎nbgrader/exchange/default/release_feedback.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,12 @@ def copy_files(self):
6767
submission_secret = fh.read()
6868

6969
checksum = notebook_hash(secret=submission_secret, notebook_id=notebook_id)
70-
dest = os.path.join(self.dest_path, "{}.html".format(checksum))
70+
dest = os.path.join(self.dest_path, "{}-tmp.html".format(checksum))
7171

7272
self.log.info("Releasing feedback for student '{}' on assignment '{}/{}/{}' ({})".format(
7373
student_id, self.coursedir.course_id, self.coursedir.assignment_id, notebook_id, timestamp))
7474
shutil.copy(html_file, dest)
75+
# Copy to temporary location and mv to update atomically.
76+
updated_feedback = os.path.join(self.dest_path, "{}.html". format(checksum))
77+
shutil.move(dest, updated_feedback)
7578
self.log.info("Feedback released to: {}".format(dest))

0 commit comments

Comments
 (0)
Please sign in to comment.