Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-45283 restore: Prevent failure when user course grade exists
When we restore a course, the grade that a user has for the grade item of the course cannot be created twice. If we try to create it when it already exists, a database exception is raised because of index duplication. The safest way to proceed is certainly to ignore the grade information from the backup, otherwise we could potentially overwrite existing information. Though, this only applies to restore as merge, and it does not affect the update of the course grade.
- Loading branch information