Browse Source

Make validation less verbose (#24)

build-from-vendor
konrad 2 years ago
committed by Gitea
parent
commit
b73786f7fe
5 changed files with 5 additions and 5 deletions
  1. +1
    -1
      pkg/models/list.go
  2. +1
    -1
      pkg/models/list_tasks.go
  3. +1
    -1
      pkg/models/list_tasks_create_update.go
  4. +1
    -1
      pkg/models/namespace.go
  5. +1
    -1
      pkg/models/user.go

+ 1
- 1
pkg/models/list.go View File

@ -10,7 +10,7 @@ type List struct {
OwnerID int64 `xorm:"int(11) INDEX" json:"-"`
NamespaceID int64 `xorm:"int(11) INDEX" json:"-" param:"namespace"`
Owner User `xorm:"-" json:"owner"`
Owner User `xorm:"-" json:"owner" valid:"-"`
Tasks []*ListTask `xorm:"-" json:"tasks"`
Created int64 `xorm:"created" json:"created"`

+ 1
- 1
pkg/models/list_tasks.go View File

@ -14,7 +14,7 @@ type ListTask struct {
Created int64 `xorm:"created" json:"created"`
Updated int64 `xorm:"updated" json:"updated"`
CreatedBy User `xorm:"-" json:"createdBy"`
CreatedBy User `xorm:"-" json:"createdBy" valid:"-"`
CRUDable `xorm:"-" json:"-"`
Rights `xorm:"-" json:"-"`

+ 1
- 1
pkg/models/list_tasks_create_update.go View File

@ -76,7 +76,7 @@ func (i *ListTask) Update() (err error) {
ot.Done = false
}
_, err = x.ID(i.ID).Cols("text", "description", "done", "due_date_unix", "reminder_unix").Update(ot)
_, err = x.ID(i.ID).Cols("text", "description", "done", "due_date_unix", "reminders_unix").Update(ot)
*i = ot
return
}

+ 1
- 1
pkg/models/namespace.go View File

@ -9,7 +9,7 @@ type Namespace struct {
Description string `xorm:"varchar(1000)" json:"description" valid:"runelength(0|250)"`
OwnerID int64 `xorm:"int(11) not null INDEX" json:"-"`
Owner User `xorm:"-" json:"owner"`
Owner User `xorm:"-" json:"owner" valid:"-"`
Created int64 `xorm:"created" json:"created"`
Updated int64 `xorm:"updated" json:"updated"`

+ 1
- 1
pkg/models/user.go View File

@ -15,7 +15,7 @@ type UserLogin struct {
// User holds information about an user
type User struct {
ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id"`
Username string `xorm:"varchar(250) not null unique" json:"username" valid:"length(5|250)"`
Username string `xorm:"varchar(250) not null unique" json:"username" valid:"length(3|250)"`
Password string `xorm:"varchar(250) not null" json:"-"`
Email string `xorm:"varchar(250)" json:"email" valid:"email,length(0|250)"`
IsActive bool `json:"-"`

Loading…
Cancel
Save