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

Catch ValueError due to approximate date with no day #887

Merged
merged 2 commits into from
Jul 27, 2023

Conversation

amakarudze
Copy link
Contributor

@amakarudze amakarudze commented May 16, 2023

If an existing organizer applies to organize an event while their old event application had an approximate date with month and year only, validation fails because the day which will be will be out of range for that month. This PR fixes #885

Changes in this PR

  • Add try...except block to the event application validation and catch the ValueError.
  • Add test for event application years apart.
  • Add test for old event application with only an approximate date with month and year only.

@codecov-commenter
Copy link

Codecov Report

Merging #887 (4979903) into main (a858d59) will decrease coverage by 0.01%.
The diff coverage is 71.42%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #887      +/-   ##
==========================================
- Coverage   80.28%   80.27%   -0.01%     
==========================================
  Files          95       95              
  Lines        2845     2849       +4     
  Branches      273      274       +1     
==========================================
+ Hits         2284     2287       +3     
- Misses        503      504       +1     
  Partials       58       58              
Impacted Files Coverage Δ
organize/models.py 90.15% <71.42%> (-0.48%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a858d59...4979903. Read the comment docs.

Copy link
Sponsor Collaborator

@marksweb marksweb left a comment

Choose a reason for hiding this comment

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

In terms of the test data, this looks good. I've just got a couple of points.

And sorry this took so long. I just found this review request at the end of my notifications.

organize/models.py Outdated Show resolved Hide resolved
organize/models.py Show resolved Hide resolved
Copy link
Sponsor Collaborator

@marksweb marksweb left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@amakarudze amakarudze merged commit a370f82 into DjangoGirls:main Jul 27, 2023
3 checks 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.

ValueError: day is out of range for month
3 participants