Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(no-ticket) Fix package reupload in PA contests by contest admins
When uploading a package to a PA contest, the PA contest controller adds a selection box for setting the tasks's division to the upload form, and adds a save_division handler to post-upload handlers, which saves the task division in problemistance. When uploading a new problem, this works fine. When a superadmin reuploads a package, the PA contest controller doesn't get involved, so all of that is skipped. However, when a contest admin who isn't a superadmin reuploads a package, the PA conteset controller does the above two things, but the save_division handler fails, because it uses 'problem_instance_id' key from the env, which is set by update_problem_instance handler only when creating a new problem instance, which doesn't happen on reupload. Fix this by making update_problem_instance handler also add the 'problem_instance_id' key when it finds a pre-existing problem instance. Change-Id: I99d89c77a75d645f390601c1bc5c2c0f7794b0f5
- Loading branch information