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

Validate Period date ranges #98

Merged
merged 2 commits into from
May 21, 2024
Merged

Validate Period date ranges #98

merged 2 commits into from
May 21, 2024

Conversation

fmrsabino
Copy link
Contributor

  • Validates that the date ranges are valid – the start_date must be on the same day or before end_date.

@fmrsabino fmrsabino self-assigned this May 16, 2024
@fmrsabino fmrsabino requested a review from a team as a code owner May 16, 2024 09:40
@coveralls
Copy link

coveralls commented May 16, 2024

Pull Request Test Coverage Report for Build 9171006346

Details

  • 20 of 20 (100.0%) changed or added relevant lines in 3 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.04%) to 90.393%

Files with Coverage Reduction New Missed Lines %
safe_locking_service/campaigns/models.py 1 96.92%
Totals Coverage Status
Change from base Build 9170529126: 0.04%
Covered Lines: 1769
Relevant Lines: 1957

💛 - Coveralls

period = PeriodFactory(end_date=end_date, start_date=start_date)

with self.assertRaises(ValidationError):
period.full_clean()
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can overwrite the Period.save() to call the validation function, what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done here 76b0cb0

@fmrsabino fmrsabino force-pushed the add-date-validators branch from be658c0 to c21faa2 Compare May 21, 2024 07:53
@fmrsabino fmrsabino force-pushed the add-date-validators branch from c21faa2 to 76b0cb0 Compare May 21, 2024 07:58
@fmrsabino fmrsabino requested a review from moisses89 May 21, 2024 08:01
@fmrsabino fmrsabino merged commit 01ae6ac into main May 21, 2024
5 checks passed
@fmrsabino fmrsabino deleted the add-date-validators branch May 21, 2024 14:33
@github-actions github-actions bot locked and limited conversation to collaborators May 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants