Remove DisabledAt for users

This commit is contained in:
William Bouzourène 2025-01-02 19:50:14 +01:00
parent 9da9cd4f61
commit 157c33227e
3 changed files with 2 additions and 10 deletions

View file

@ -3,7 +3,6 @@ package helpers
import (
"errors"
"fmt"
"time"
"git.readonly.ch/bouzoure/popvaud-people/models"
"github.com/gofiber/fiber/v2"
@ -63,7 +62,7 @@ func UserExistsAndIsActive(id uint) (bool, error) {
}
var user models.User
result := db.First(&user, "id = ? AND (disabled_at IS NULL OR disabled_at <= ?)", id, time.Now())
result := db.First(&user, "id = ?", id)
if errors.Is(result.Error, gorm.ErrRecordNotFound) {
return false, nil