fix: closing some issues from sonarqube
Some checks failed
Tests / Run Go Tests (push) Failing after 59s

This commit is contained in:
2026-02-15 18:49:29 +01:00
parent 10df10a606
commit b4bf550863
4 changed files with 4 additions and 13 deletions

View File

@@ -21,7 +21,7 @@ import (
const DE_DATE string = "02.01.2006" const DE_DATE string = "02.01.2006"
const FILE_YEAR_MONTH string = "2006_01" const FILE_YEAR_MONTH string = "2006_01"
var PDF_DIRECTORY = helper.GetEnv("PDF_PATH", "/doc/") // TODO var PDF_DIRECTORY = helper.GetEnv("PDF_PATH", "/doc/")
func PDFCreateController(w http.ResponseWriter, r *http.Request) { func PDFCreateController(w http.ResponseWriter, r *http.Request) {
helper.RequiresLogin(Session, w, r) helper.RequiresLogin(Session, w, r)

View File

@@ -257,12 +257,6 @@ func updateAbsence(r *http.Request) error {
log.Println("Cannot get Absence for id: ", absenceId, err) log.Println("Cannot get Absence for id: ", absenceId, err)
return err return err
} }
if r.FormValue("action") == "delete" {
log.Println("Deleting Absence!", "Not implemented")
// TODO
//absence.Delete()
return nil
}
if absence.Update(newAbsence) { if absence.Update(newAbsence) {
err = absence.Save() err = absence.Save()
@@ -272,5 +266,4 @@ func updateAbsence(r *http.Request) error {
} }
} }
return nil return nil
} }

View File

@@ -17,8 +17,8 @@ type FileLog struct {
var Logs map[string]FileLog = make(map[string]FileLog) var Logs map[string]FileLog = make(map[string]FileLog)
func NewAudit() (i *log.Logger, close func() error) { func NewAudit() (i *log.Logger, close func() error) {
LOG_FILE := "logs/" + time.Now().Format(time.DateOnly) + ".log" logName := "logs/" + time.Now().Format(time.DateOnly) + ".log"
logFile, err := os.OpenFile(LOG_FILE, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) logFile, err := os.OpenFile(logName, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
if err != nil { if err != nil {
log.Panic(err) log.Panic(err)
} }

View File

@@ -21,9 +21,7 @@ type CompoundDay struct {
func (c *CompoundDay) IsSubmittedAndAccepted() bool { func (c *CompoundDay) IsSubmittedAndAccepted() bool {
var isSubmittedAndAccepted = true var isSubmittedAndAccepted = true
for _, day := range c.DayParts { for _, day := range c.DayParts {
_isSubmittedAndAccepted := day.IsSubmittedAndAccepted() isSubmittedAndAccepted = isSubmittedAndAccepted && day.IsSubmittedAndAccepted()
isSubmittedAndAccepted = isSubmittedAndAccepted && _isSubmittedAndAccepted
slog.Info("Result from IsSubmittedCheck", "Result", _isSubmittedAndAccepted, "compount", day.ToString())
} }
return isSubmittedAndAccepted return isSubmittedAndAccepted
} }