Skip to content

Fix #1558: Add date validation constraints for challenge phases#4982

Open
jaideepj2004 wants to merge 2 commits into
Cloud-CV:masterfrom
jaideepj2004:fix-phase-date-constraints-1558
Open

Fix #1558: Add date validation constraints for challenge phases#4982
jaideepj2004 wants to merge 2 commits into
Cloud-CV:masterfrom
jaideepj2004:fix-phase-date-constraints-1558

Conversation

@jaideepj2004
Copy link
Copy Markdown
Contributor

Description

Fixes #1558

This PR adds comprehensive date validation constraints for challenge phases to ensure logical consistency between challenge and phase dates.

Changes Made

  • Added validation in ChallengePhase.save() method to enforce 6 date constraints:

    • Challenge start date must be before challenge end date
    • Phase start date must be before phase end date
    • Phase start date must be >= challenge start date
    • Phase start date must be < challenge end date
    • Phase end date must be > challenge start date
    • Phase end date must be <= challenge end date
  • Added comprehensive unit tests in ChallengePhaseDateValidationTestCase covering:

    • All invalid date scenarios (raises ValidationError)
    • Valid date configurations (edge cases included)
    • 9 test methods ensuring complete coverage

Testing

  • All validation scenarios tested with unit tests
  • No syntax errors in Python code
  • Maintains backward compatibility with existing functionality

References

… errors from FAQ

- Removed outdated pip/virtualenv installation instructions
- Removed bower, gulp, npm, and sass installation errors
- Removed Python 2.7 specific errors
- Removed proxy/network configuration for npm
- Removed karma and mocha errors
- Kept only Docker-related errors relevant to current setup
- Updated setup recommendation to use Docker-based environment

All removed sections are incompatible with the current Docker-based workflow.
- Add validation to ensure phase start/end dates are within challenge dates
- Validate that phase start date is before phase end date
- Validate that challenge start date is before challenge end date
- Add comprehensive unit tests covering all validation scenarios
- Tests include edge cases and valid date configurations
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.

Add constraints for setting challenge phase start and end date

1 participant