Compare commits

..

No commits in common. "e32d5023aa0b8e5fc73cc248273cfe1340cd1976" and "9632545d9452960c399fd15074ff2bf0e3767a00" have entirely different histories.

2 changed files with 3 additions and 3 deletions

View file

@ -107,8 +107,8 @@ func (r *RequestRepo) Execute(request models.Request) error {
_, err = r.db.Exec("UPDATE officeHour SET active=true WHERE id=?", request.OfficeHour.Id) _, err = r.db.Exec("UPDATE officeHour SET active=true WHERE id=?", request.OfficeHour.Id)
r.db.Exec("DELETE FROM request WHERE officeHour=?", request.OfficeHour.Id) r.db.Exec("DELETE FROM request WHERE officeHour=?", request.OfficeHour.Id)
case models.RequestDelete: case models.RequestDelete:
r.db.Exec("DELETE FROM request WHERE officeHour=?", request.OfficeHour.Id)
err = r.officeHourRepo.Delete(request.OfficeHour) err = r.officeHourRepo.Delete(request.OfficeHour)
r.db.Exec("DELETE FROM request WHERE officeHour=?", request.OfficeHour.Id)
default: default:
log.Printf("Executing request: Action type %d unknown.", request.Action) log.Printf("Executing request: Action type %d unknown.", request.Action)
_, err = r.db.Exec("DELETE FROM request WHERE id=?", request.Id) _, err = r.db.Exec("DELETE FROM request WHERE id=?", request.Id)

View file

@ -1,11 +1,11 @@
From: {{.Config.Mailer.FromName}} From: {{.Config.Mailer.FromName}}
To: {{.Request.OfficeHour.Tutor.Email}} To: {{.Request.OfficeHour.Tutor.Email}}
Subject: Sprechstunde {{if eq .Request.Action 0}}anlegen{{end}}{{if eq .Request.Action 1}}löschen{{end}} Subject: Sprechstunde {{if eq .Request.Action 1}}anlegen{{end}}{{if eq .Request.Action 2}}löschen{{end}}
Message-Id: {{.MessageId}} Message-Id: {{.MessageId}}
Hallo {{.Request.OfficeHour.Tutor.Name}}, Hallo {{.Request.OfficeHour.Tutor.Name}},
mit deiner Emailadresse soll eine Sprechstunde mit folgenden Daten {{if eq .Request.Action 0}}angelegt werden{{end}}{{if eq .Request.Action 1}}gelöscht werden{{end}}: mit deiner Emailadresse soll eine Sprechstunde mit folgenden Daten {{if eq .Request.Action 1}}angelegt werden{{end}}{{if eq .Request.Action 2}}gelöscht werden{{end}}:
{{.Request.OfficeHour.Course.Name}} {{.Request.OfficeHour.Course.Name}}
{{DayName .Request.OfficeHour.Date.Day}} {{DayName .Request.OfficeHour.Date.Day}}