- if @user
- @notes = @user.notes
- @notes = closed_condition(@notes)
- elsif params[:display_name] || params[:id]
- # Return an error message because obviously the user could not be found
- raise OSM::APIBadUserInput, "The user could not be found"
- else
- @notes = closed_condition(Note.all)
- end
+ # Add any user filter
+ if params[:display_name] || params[:user]
+ if params[:display_name]
+ @user = User.find_by(:display_name => params[:display_name])