Skip to content

Validate number of days in account log search form #3289

Merged
johannaengland merged 1 commit intoUninett:masterfrom
johannaengland:bugfix/account-log-search-form-days
Mar 6, 2025
Merged

Validate number of days in account log search form #3289
johannaengland merged 1 commit intoUninett:masterfrom
johannaengland:bugfix/account-log-search-form-days

Conversation

@johannaengland
Copy link
Copy Markdown
Contributor

@johannaengland johannaengland commented Feb 20, 2025

Closes #3247. Dependent on #3295.

Copy link
Copy Markdown
Contributor

@hmpf hmpf left a comment

Choose a reason for hiding this comment

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

I approved the sub-PR of this one, but: this could be DRYed. Three of the same thing, no?

def validate_datetime_for_overflow(timeobj, td: timedelta):
    try:
        datetime.now() - td
    except OverflowError:
        raise forms.ValidationError("They did not have computers %s days ago" % timeobj)

@johannaengland
Copy link
Copy Markdown
Contributor Author

I approved the sub-PR of this one, but: this could be DRYed. Three of the same thing, no?

Very good idea!

@johannaengland johannaengland force-pushed the bugfix/account-log-search-form-days branch from 1dc5ad8 to 9640b46 Compare February 26, 2025 12:10
@johannaengland johannaengland changed the base branch from master to cleanup/utils-validate-timedelta-overflow February 26, 2025 12:10
@johannaengland johannaengland requested a review from hmpf February 26, 2025 12:11
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.77%. Comparing base (973a4ba) to head (7e0a6b0).
Report is 122 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3289      +/-   ##
==========================================
- Coverage   60.78%   60.77%   -0.01%     
==========================================
  Files         606      606              
  Lines       43762    43767       +5     
  Branches       48       48              
==========================================
+ Hits        26599    26600       +1     
- Misses      17151    17155       +4     
  Partials       12       12              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@johannaengland johannaengland deleted the branch Uninett:master February 26, 2025 12:23
@johannaengland johannaengland changed the base branch from cleanup/utils-validate-timedelta-overflow to master February 26, 2025 12:34
@johannaengland johannaengland force-pushed the bugfix/account-log-search-form-days branch from 9640b46 to ffd84ab Compare February 26, 2025 14:19
@johannaengland johannaengland changed the title Clean number of days in account log search form Validate number of days in account log search form Feb 26, 2025
@johannaengland johannaengland force-pushed the bugfix/account-log-search-form-days branch from ffd84ab to 7e0a6b0 Compare March 6, 2025 07:43
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Mar 6, 2025

@johannaengland johannaengland merged commit f94230d into Uninett:master Mar 6, 2025
15 checks passed
@johannaengland johannaengland deleted the bugfix/account-log-search-form-days branch March 6, 2025 08:17
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.

[BUG] Giving a big number as input for AccountLogSearchForm causes a 500 error

3 participants