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
Can't change course id in Courses admin #613
Comments
I noticed that saving the course object after converting canvas id to incremented id will update the course view options after saving the course. |
I was trying to override the save_model() function using save(force_update=True). Is it possible to do something like this to ensure that the course instance gets the updated id instead of creating a new instance? |
Testing shows that this behavior still occurs in the most recent release. |
1 similar comment
Testing shows that this behavior still occurs in the most recent release. |
In my initial testing, I did not see the same stack trace that @jonespm highlighted in the initial issue, but I did see that a new course is created upon updating the course ID, with the old one still being there. I believe this occurs because of the
I guess the edited object gets saved as a brand new object because of the new primary key, and it loses the connection to the We could possibly modify As discussed in the meeting, it seems like it a more intuitive workflow for this would be to just delete the old course and create a new one with the new ID. We can disallow changing the course ID in the admin form to prevent the bugs described in the issue. |
Testing passes in beta - the course ID is not editable. |
Thank you for contributing to this project!
Expected behavior (A clear and concise description of what you expected to happen) :
When I change the ID in the courses admin for a course, it should change the ID
Describe the bug (Tell us what happens instead of the expected behavior) :
When I change the ID there is a stack trace. It looks like it creates another course with none of the default view options set with this course ID and keeps the original. The error looks like it's in Django.
Steps to Reproduce :
Screenshots/Video (If possible, add media to help explain your problem) :
Additional context (Add any other context about the problem here) :
Test Plan:
The text was updated successfully, but these errors were encountered: