about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/http.go18
1 files 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