diff --git a/orm/participant.go b/orm/participant.go index 5fd58a6c..24aa8b75 100644 --- a/orm/participant.go +++ b/orm/participant.go @@ -2,6 +2,7 @@ package orm import ( "fmt" + "log" "net/http" "strconv" @@ -186,6 +187,7 @@ func (model *Participant) Create(db *Database, args map[string]string, w http.Re } // Check if participant exists + log.Printf("Check if participant %s already exists", participant) if user, err := participant.exists(db); err == nil && user != nil { if err := db._db.Where("user_id = ?", user.ID).Find(&participant).Error; err != nil { return nil, err @@ -210,6 +212,7 @@ func (model *Participant) Create(db *Database, args map[string]string, w http.Re if err := db._db.First(&school, participant.SchoolID).Error; err != nil { return nil, err } + log.Printf("Check if a participant of the same category exists for school %s", school) hasCategory, err := school.HasCategory(db, participant) if err != nil { return nil, err @@ -221,6 +224,8 @@ func (model *Participant) Create(db *Database, args map[string]string, w http.Re WriteCreator(r, participant) + log.Printf("Create participant %s", participant) + participant, err = CreateParticipant(db, participant) if err != nil { return nil, err