fixed #70 + made db script ignore double bookings
Some checks failed
Tests / Run Go Tests (push) Failing after 2m0s
Some checks failed
Tests / Run Go Tests (push) Failing after 2m0s
This commit is contained in:
@@ -160,19 +160,13 @@ func updateBooking(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
newBooking := (*models.Booking).New(nil, user.CardUID, 0, int16(check_in_out), 1)
|
||||
newBooking.Timestamp = timestamp
|
||||
err = newBooking.InsertWithTimestamp()
|
||||
if err != nil {
|
||||
log.Printf("Error inserting booking %v -> %v\n", newBooking, err)
|
||||
if newBooking.Verify() {
|
||||
err = newBooking.InsertWithTimestamp()
|
||||
if err != nil {
|
||||
log.Printf("Error inserting booking %v -> %v\n", newBooking, err)
|
||||
}
|
||||
}
|
||||
case "change":
|
||||
// absenceType, err := strconv.Atoi(r.FormValue("absence"))
|
||||
// if err != nil {
|
||||
// log.Println("Error parsing absence type.", err)
|
||||
// absenceType = 0
|
||||
// }
|
||||
// if absenceType != 0 {
|
||||
// createAbsence(absenceType, user, loc, r)
|
||||
// }
|
||||
for index, possibleBooking := range r.PostForm {
|
||||
if len(index) > 7 && index[:7] == "booking" {
|
||||
booking_id, err := strconv.Atoi(index[8:])
|
||||
|
||||
Reference in New Issue
Block a user