You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you call this function with user_search_string set to None or search_by set to anything other than "all_fields" or "username_only" then the entries variable will not be assigned a value (and the return value from User.object.all() will be ignored too).
I was able to reproduce this in the hpc-toolset-tutorial docker images by using curl to call the /user/user-search-results endpoint and editing the POST parameters to pass in a different value of the 'search_by' parameter (I've stripped out the auth tokens - not that it matters too much since this was in a throwaway docker):
Thanks for reporting this and for the cURL test. I was able to reproduce and this PR fixed the issue. Looks like this case was never being reached as the javascript was preventing an empty search string from being submitted. Good catch!
The
search_a_user
function in theLocalUserSearch
class has a code path that leads referencing an undefined variable. Offending code athttps://github.com/ubccr/coldfront/blob/master/coldfront/core/user/utils.py#L56
If you call this function with
user_search_string
set toNone
orsearch_by
set to anything other than "all_fields" or "username_only" then theentries
variable will not be assigned a value (and the return value from User.object.all() will be ignored too).I was able to reproduce this in the hpc-toolset-tutorial docker images by using curl to call the
/user/user-search-results
endpoint and editing the POST parameters to pass in a different value of the 'search_by' parameter (I've stripped out the auth tokens - not that it matters too much since this was in a throwaway docker):Error output:
The text was updated successfully, but these errors were encountered: