Skip to content
Snippets Groups Projects
Commit 14e4cda4 authored by Bjarke Madsen's avatar Bjarke Madsen
Browse files

Match against nren when searching in user management

parent 3363cc7e
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## [0.95] - 2025-03-21
- COMP-461: Also match nren name when searching in user management
## [0.94] - 2025-03-19 ## [0.94] - 2025-03-19
- Fix Excel export for data that includes null values - Fix Excel export for data that includes null values
......
...@@ -238,7 +238,13 @@ function UserManagementComponent() { ...@@ -238,7 +238,13 @@ function UserManagementComponent() {
const sortFunction = sortFunctions[sortColumn.column] ?? defaultSortFunction const sortFunction = sortFunctions[sortColumn.column] ?? defaultSortFunction
const filteredUsers = filter ? users.filter((u) => u.email.includes(filter) || u.name.includes(filter)) : users const lowercaseFilter = filter ? filter.toLowerCase() : filter
const filteredUsers = filter ? users.filter((u) =>
u.email.toLowerCase().includes(lowercaseFilter)
|| u.name.toLowerCase().includes(lowercaseFilter)
|| u.nrens.some((nren) => nren.toLowerCase().includes(lowercaseFilter)
)) : users
const userList = filteredUsers.filter((u) => u.id !== loggedInUser.id).sort(sortFunction) const userList = filteredUsers.filter((u) => u.id !== loggedInUser.id).sort(sortFunction)
if (!sortColumn.asc) { if (!sortColumn.asc) {
userList.reverse() userList.reverse()
......
...@@ -298,6 +298,8 @@ def publish(year, dry_run=False): ...@@ -298,6 +298,8 @@ def publish(year, dry_run=False):
select(SurveyResponse).where( select(SurveyResponse).where(
SurveyResponse.survey_year == year, SurveyResponse.status == ResponseStatus.completed, SurveyResponse.survey_year == year, SurveyResponse.status == ResponseStatus.completed,
SurveyResponse.valid == True).where(~SurveyResponse.nren_id.in_( # noqa: E712 SurveyResponse.valid == True).where(~SurveyResponse.nren_id.in_( # noqa: E712
# If any NRENs are in this table, new surveys will not be generated for them.
# This is a catch to ensure that existing survey data doesn't make it through publishing.
select(NRENExclusion.nren_id).where(NRENExclusion.year == year) select(NRENExclusion.nren_id).where(NRENExclusion.year == year)
) )
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment