Add some log messaging trying to debug participant creation bug

This commit is contained in:
Andrea Fazzi 2020-12-29 18:58:58 +01:00
parent 71cf5d6b31
commit 286f6f083f

View file

@ -108,8 +108,12 @@ func (model *Participant) exists(db *Database) (*User, error) {
if err := db._db.First(&user, &User{Username: model.username()}).Error; err != nil && err != gorm.ErrRecordNotFound {
return nil, err
} else if err == gorm.ErrRecordNotFound {
log.Printf("User %s doesn't exist", user)
return nil, nil
}
log.Printf("User %s exists", user)
return &user, nil
}