Skip to content

Commit

Permalink
Fix #48
Browse files Browse the repository at this point in the history
  • Loading branch information
apardyl committed Jan 9, 2019
1 parent 3378d2b commit 7dc34da
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package pl.edu.uj.ii.ksi.mordor.controllers.admin

import javax.validation.Valid
import org.springframework.beans.propertyeditors.StringTrimmerEditor
import org.springframework.data.domain.PageRequest
import org.springframework.http.HttpStatus
import org.springframework.security.access.annotation.Secured
import org.springframework.stereotype.Controller
import org.springframework.validation.BindingResult
import org.springframework.web.bind.WebDataBinder
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.InitBinder
import org.springframework.web.bind.annotation.ModelAttribute
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.PostMapping
Expand All @@ -27,6 +30,11 @@ class UsersController(private val userRepository: UserRepository, private val us
private const val usersPerPage = 100
}

@InitBinder
fun initBinder(binder: WebDataBinder) {
binder.registerCustomEditor(String::class.java, StringTrimmerEditor(true))
}

@Secured(Permission.ACCESS_ADMIN_PANEL_STR)
@GetMapping("/admin/users/")
fun userList(): View {
Expand Down

0 comments on commit 7dc34da

Please sign in to comment.