diff --git a/controllers/members.go b/controllers/members.go index 569c3ad..52eda37 100644 --- a/controllers/members.go +++ b/controllers/members.go @@ -933,7 +933,7 @@ func MemberEdit(c *fiber.Ctx) error { personAccount.Enabled = true personAccount.Groups = strings.Join(authelia.GetPersonGroups(person.ID), "|||") - if personAccount.AccountCreated { + if personAccount.AccountCreated.Valid { personAccount.UpdateNeeded = true } @@ -941,7 +941,7 @@ func MemberEdit(c *fiber.Ctx) error { } else if c.FormValue("account-enabled") != "on" && personAccount.ID > 0 { personAccount.Enabled = false - if personAccount.AccountCreated { + if personAccount.AccountCreated.Valid { personAccount.UpdateNeeded = true } diff --git a/models/people.go b/models/people.go index f711d97..4b0bafc 100644 --- a/models/people.go +++ b/models/people.go @@ -26,14 +26,12 @@ type Person struct { type PersonAccount struct { gorm.Model - PersonID uint - Person Person - UUID uuid.UUID `gorm:"unique"` - Enabled bool - Groups string - InitialPassword string - InvitationSent sql.NullTime - AccountReady bool - AccountCreated bool - UpdateNeeded bool + PersonID uint + Person Person + UUID uuid.UUID `gorm:"unique"` + Enabled bool + Groups string + AccountCreated sql.NullTime + InvitationSent sql.NullTime + UpdateNeeded bool }