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

Prevent deletion of contests when contest voting file is present #1002

Merged
merged 28 commits into from
Sep 20, 2023

Conversation

kjw142857
Copy link
Contributor

@kjw142857 kjw142857 commented Sep 17, 2023

Modified delete_assessment so that if a corresponding contest voting file has been uploaded, deleting the contest file is not allowed (400 error code) until the contest voting file has been deleted first.

In addition, added an additional check during retrieval of fetch_unassigned_voting_questions that each question must reference an existing contest.

@coveralls
Copy link

coveralls commented Sep 17, 2023

Coverage Status

coverage: 95.408% (+0.02%) from 95.388% when pulling bb7cf43 on kjw142857:master into fdeb111 on source-academy:master.

Copy link
Member

@RichDom2185 RichDom2185 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but can we add tests, please? Thanks a lot!

@kjw142857
Copy link
Contributor Author

kjw142857 commented Sep 18, 2023

Update:

  • Tests have been added
  • Additional check during fetch_unassigned_voting_questions has been added to ensure that insert_voting is never called if the voting question references a nonexistent contest, which could possibly happen due to data corruption or direct modification of the DB
  • Check added for the referencing voting question to be in the same course when a contest assessment is attempted to be deleted

@kjw142857 kjw142857 marked this pull request as draft September 18, 2023 09:34
@kjw142857 kjw142857 marked this pull request as ready for review September 19, 2023 09:11
Copy link
Member

@RichDom2185 RichDom2185 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@RichDom2185 RichDom2185 merged commit b2422a4 into source-academy:master Sep 20, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants