Skip to content
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

Empty date fields when adding a course instance results in 500 internal server error #1174

Closed
lainets opened this issue Apr 11, 2023 · 1 comment · Fixed by #1186
Closed
Assignees
Labels
area: admin Issues related to server administration and service upkeep effort: hours Estimated to take less than one day, from the creation of a new branch to the merging experience: good first issue Good for newcomers requester: team The issue is raised by a person inside the A+ developer team type: bug This is a bug
Milestone

Comments

@lainets
Copy link
Contributor

lainets commented Apr 11, 2023

Saving a new course instance with the required date fields left empty causes an internal server error. Seems like the field validation doesn't check for empty fields.

@markkuriekkinen
Copy link
Collaborator

The crash occurred in the Django admin page for creating new CourseInstances. The code in CourseInstance.clean() clearly tries to use the mandatory starting and ending times before checking if the values are None. The less than comparison with the None value causes a crash.

if self.ending_time <= self.starting_time:

@markkuriekkinen markkuriekkinen added type: bug This is a bug experience: good first issue Good for newcomers area: admin Issues related to server administration and service upkeep effort: hours Estimated to take less than one day, from the creation of a new branch to the merging requester: team The issue is raised by a person inside the A+ developer team labels Apr 15, 2023
@markkuriekkinen markkuriekkinen added this to the v1.19 milestone Apr 15, 2023
@lainets lainets self-assigned this May 30, 2023
lainets added a commit to lainets/a-plus that referenced this issue May 30, 2023
lainets added a commit to lainets/a-plus that referenced this issue May 30, 2023
markkuriekkinen pushed a commit to markkuriekkinen/a-plus that referenced this issue Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: admin Issues related to server administration and service upkeep effort: hours Estimated to take less than one day, from the creation of a new branch to the merging experience: good first issue Good for newcomers requester: team The issue is raised by a person inside the A+ developer team type: bug This is a bug
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants