Improved validation on tag terms
This commit is contained in:
parent
c2e06354c2
commit
7ab9409ef0
@ -8,6 +8,7 @@ import javax.persistence.JoinColumn
|
||||
import javax.persistence.JoinTable
|
||||
import javax.persistence.ManyToMany
|
||||
import javax.persistence.ManyToOne
|
||||
import javax.validation.constraints.Pattern
|
||||
|
||||
@Entity
|
||||
open class User(
|
||||
@ -56,6 +57,7 @@ open class Image(
|
||||
@Entity
|
||||
open class Tag(
|
||||
@Column(unique = true)
|
||||
@Pattern(regexp = "[a-zA-Z0-9_]*") // Only allow alphanumeric and underscores
|
||||
open var tag: String = "",
|
||||
@Id open var id: Long = -1
|
||||
)
|
Loading…
Reference in New Issue
Block a user