Skip to content

Fix all-time searches in radius tool#3507

Merged
johannaengland merged 2 commits intoUninett:5.14.xfrom
johannaengland:bugfix/all-time-search-radius
Sep 8, 2025
Merged

Fix all-time searches in radius tool#3507
johannaengland merged 2 commits intoUninett:5.14.xfrom
johannaengland:bugfix/all-time-search-radius

Conversation

@johannaengland
Copy link
Copy Markdown
Contributor

@johannaengland johannaengland commented Sep 4, 2025

Scope and purpose

Fixes #3500.

Reason for this bug: In the case of all-time searches cleaned_data["time"] is [].

Contributor Checklist

Every pull request should have this checklist filled out, no matter how small it is.
More information about contributing to NAV can be found in the
Hacker's guide to NAV.

  • Added a changelog fragment for towncrier
  • Added/amended tests for new/changed code
  • Added/changed documentation
    • bugfix
  • Linted/formatted the code with ruff, easiest by using pre-commit
  • The first line of the commit message continues the sentence "If applied, this commit will ...", starts with a capital letter, does not end with punctuation and is 50 characters or less long. See https://cbea.ms/git-commit/
  • This pull request is based on the correct upstream branch: For a patch/bugfix affecting the latest stable version, it should be based on that version's branch (<major>.<minor>.x). For a new feature or other additions, it should be based on master.
  • If applicable: Created new issues if this PR does not fix the issue completely/there is further work to be done
  • If this results in changes in the UI: Added screenshots of the before and after
  • If this adds a new Python source code file: Added the boilerplate header to that file

@johannaengland johannaengland requested a review from a team September 4, 2025 13:17
@johannaengland johannaengland self-assigned this Sep 4, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Sep 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.28%. Comparing base (96bfc59) to head (1e89ca7).
⚠️ Report is 19 commits behind head on 5.14.x.

Additional details and impacted files
@@            Coverage Diff             @@
##           5.14.x    #3507      +/-   ##
==========================================
+ Coverage   61.05%   61.28%   +0.22%     
==========================================
  Files         610      610              
  Lines       44711    44713       +2     
  Branches       43       43              
==========================================
+ Hits        27300    27401     +101     
+ Misses      17401    17302      -99     
  Partials       10       10              

☔ 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.

In the case of all-time searches cleaned_data["time"] is []
@johannaengland johannaengland force-pushed the bugfix/all-time-search-radius branch from 18403fe to a0f0a1b Compare September 5, 2025 08:13
@johannaengland johannaengland marked this pull request as ready for review September 5, 2025 08:18
Simrayz
Simrayz previously approved these changes Sep 5, 2025
Copy link
Copy Markdown
Contributor

@Simrayz Simrayz left a comment

Choose a reason for hiding this comment

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

Tested and working 😄 This will be helpful when replacing the details modal.

My only (quite optional) suggestion is to use dictionaries for the parameters instead, and use urlencode,
e.g.

url = reverse('some-url')
params = {
    'query_0': 'username',
    'query_1': admin_username,
    'time_0': 'days',
    'time_1': 123123123123,
    'port_type': '',
    'send': 'Search'
}
url = url + '?' + urlencode(params)

This increases the readability of the code and makes it easier to identify the difference between the passed paramteres. However, this is obviously more verbose than using query strings, so feel free to merge.

@johannaengland
Copy link
Copy Markdown
Contributor Author

My only (quite optional) suggestion is to use dictionaries for the parameters instead, and use urlencode

That is a really good suggestion! Will do!

Copy link
Copy Markdown
Contributor

@Simrayz Simrayz left a comment

Choose a reason for hiding this comment

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

Nice 💯

@johannaengland johannaengland force-pushed the bugfix/all-time-search-radius branch from d4962e6 to 1e89ca7 Compare September 8, 2025 09:20
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Sep 8, 2025

@johannaengland johannaengland merged commit 9aa0116 into Uninett:5.14.x Sep 8, 2025
16 checks passed
@johannaengland johannaengland deleted the bugfix/all-time-search-radius branch September 8, 2025 09:31
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] All-time user searches (the default) in Radius accounting tool is broken

2 participants