Skip to content

Commit

Permalink
Merge pull request #17 from vshn/fix-uid
Browse files Browse the repository at this point in the history
Fix wrong session ID
  • Loading branch information
ccremer authored Nov 10, 2021
2 parents 974d355 + 2ded27f commit b3730a6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/web/attendance_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ func (s Server) OvertimeReport() http.Handler {
forAnotherUser := r.FormValue("userscope") == "user-foreign-radio"
searchUser := r.FormValue("username")

userId := session.UID
var employee *odoo.Employee
if forAnotherUser {
e, err := s.odoo.SearchEmployee(searchUser, session.ID)
Expand All @@ -39,21 +38,21 @@ func (s Server) OvertimeReport() http.Handler {
}
employee = e
} else {
e, err := s.odoo.FetchEmployee(userId, session.ID)
e, err := s.odoo.FetchEmployee(session.UID, session.ID)
if err != nil {
view.ShowError(w, err)
return
}
employee = e
}

attendances, err := s.odoo.ReadAllAttendances(session.ID, userId)
attendances, err := s.odoo.ReadAllAttendances(session.ID, employee.ID)
if err != nil {
view.ShowError(w, err)
return
}

leaves, err := s.odoo.ReadAllLeaves(session.ID, userId)
leaves, err := s.odoo.ReadAllLeaves(session.ID, employee.ID)
if err != nil {
view.ShowError(w, err)
return
Expand Down

0 comments on commit b3730a6

Please sign in to comment.