From a03aec45993ecf708a5b0401ad87b78902327424 Mon Sep 17 00:00:00 2001 From: Emile Date: Sat, 19 Oct 2019 23:15:58 +0200 Subject: using the dbGetChallengeByUUID function --- src/http.go | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/http.go b/src/http.go index 7be863d..d39b879 100644 --- a/src/http.go +++ b/src/http.go @@ -129,24 +129,14 @@ func editGetHandler(w http.ResponseWriter, r *http.Request) { log.Printf("fetching challenge with the uuid %s", uuid) - //chall := dbGetChallengeByUUID(uuid) - // - // temporary test challenge used while the dbGetChallengeByUUID function - // has not been implemented: - chall := Challenge{ - UUID: uuid, - Name: "random challenge name", - Description: "some bad description", - Flag: "FLAG", - Container: "container-randomchallenge", - Category: "guess", - Points: 100, - Static: false, + chall, err := dbGetChallengeByUUID(uuid) + if err != nil { + log.Println(err) } // define a new template to render the challenges in t := template.New("") - t, err := t.ParseFiles("./hosted/edit_uuid.html") + t, err = t.ParseFiles("./hosted/edit_uuid.html") if err != nil { log.Println(err) return -- cgit 1.4.1