You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make sure to search the issues for duplicates first!
Expected behavior (A clear and concise description of what you expected to happen) :
When a new Course is created in the Django admin interface, a new CourseViewOption record should also be created, regardless of what boxes are checked for the three view inline settings ("Show Resources Accessed View", "Show Assignment Planning View," and "Show Grade Distribution View").
Describe the bug (Tell us what happens instead of the expected behavior) :
When a new Course is created through the Admin with the default options selected for the CourseViewOption inline integer fields, a new CourseViewOption record is NOT created. If you uncheck any of the boxes (diverging from the default), a CourseViewOption record is created.
Steps to Reproduce :
In the Django admin interface, click the "Add Course" button.
Fill out the form without modifying the three CourseViewOption checkboxes.
Look at the Courses Dashboard, where there will be no views listed under "COURSE VIEW OPTION(S)" for the new course. Alternatively, look at the course_view_option table in the database, noting the absence of a new record.
Screenshots/Video (If possible, add media to help explain your problem) :
Additional context (Add any other context about the problem here) :
This bug was previously documented and fixed by @jonespm (see PR #452). I believe it was reintroduced when I removed the editable=false option from the id field in Course in models.py as part of PR #652 (thanks to @pushyamig for alerting me to the issue!). This bug could be fixed by re-adding the editable=false option. However, this problem and Issue #613 might be fixed by adding AutoField primary keys to both the Course and CourseViewOption models and making the table relationship dependent on those ids rather than field values we may want to change. I will investigate the latter option and report back. If that is a dead end, I will re-add the editable=false option.
The text was updated successfully, but these errors were encountered:
The save_model override of CourseAdmin is intended for creating and saving the id based on the canvas_id. This isn't a field the user should need to enter. It's possible this isn't executing correctly if this isn't in there.
I've been experimenting with using readonly_fields in the CourseAdmin rather than using editable=false. It's nice that the field still shows up in the interface, without being editable. The editableoption does seem to be more global, which could be an advantage. Both seem to solve this issue, making the AlwaysChangedModelForm work as expected.
Thank you for contributing to this project!
Expected behavior (A clear and concise description of what you expected to happen) :
When a new
Course
is created in the Django admin interface, a newCourseViewOption
record should also be created, regardless of what boxes are checked for the three view inline settings ("Show Resources Accessed View", "Show Assignment Planning View," and "Show Grade Distribution View").Describe the bug (Tell us what happens instead of the expected behavior) :
When a new
Course
is created through the Admin with the default options selected for theCourseViewOption
inline integer fields, a newCourseViewOption
record is NOT created. If you uncheck any of the boxes (diverging from the default), aCourseViewOption
record is created.Steps to Reproduce :
CourseViewOption
checkboxes.course_view_option
table in the database, noting the absence of a new record.Screenshots/Video (If possible, add media to help explain your problem) :
Additional context (Add any other context about the problem here) :
This bug was previously documented and fixed by @jonespm (see PR #452). I believe it was reintroduced when I removed the
editable=false
option from theid
field inCourse
inmodels.py
as part of PR #652 (thanks to @pushyamig for alerting me to the issue!). This bug could be fixed by re-adding theeditable=false
option. However, this problem and Issue #613 might be fixed by addingAutoField
primary keys to both theCourse
andCourseViewOption
models and making the table relationship dependent on those ids rather than field values we may want to change. I will investigate the latter option and report back. If that is a dead end, I will re-add theeditable=false
option.The text was updated successfully, but these errors were encountered: