aboutsummaryrefslogtreecommitdiff
path: root/modules/lists
diff options
context:
space:
mode:
authorrtz12 <koenig@fagott.pw>2016-10-12 20:48:59 (UTC)
committerrtz12 <koenig@fagott.pw>2016-10-12 20:48:59 (UTC)
commit593659727c0b30e8806dbd622c45760865467be2 (patch)
treea63d493624100cd895be7a56624e5d4d0cb4a1e2 /modules/lists
parent6fba92d36432d28e3ad62e6b3da5a3b807011482 (diff)
So funktioniert das glaube ich besser...
Diffstat (limited to 'modules/lists')
-rw-r--r--modules/lists/lists.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/modules/lists/lists.go b/modules/lists/lists.go
index a6d0284..753a7be 100644
--- a/modules/lists/lists.go
+++ b/modules/lists/lists.go
@@ -426,17 +426,14 @@ func (m *Module) updateListSettings(w http.ResponseWriter, r *http.Request, p ht
426 return 426 return
427 } 427 }
428 428
429 rows, err := m.g.DB.Query("SELECT name, description FROM grilist.lists WHERE id = $1;", id) 429 var oldName string
430 var oldDescription string
431 err = m.g.DB.QueryRow("SELECT name, description FROM grilist.lists WHERE id = $1;", id).Scan(&oldName, &oldDescription)
430 if err != nil { 432 if err != nil {
431 log.Println("could not get list info", id) 433 log.Println("could not get list info", id)
432 renderWithError("interner fehler", false, false) 434 renderWithError("interner fehler", false, false)
433 return 435 return
434 } 436 }
435 defer rows.Close()
436
437 var oldName string
438 var oldDescription string
439 rows.Scan(&oldName, &oldDescription)
440 437
441 if list.Name != name && list.Description != description { 438 if list.Name != name && list.Description != description {
442 _, err = m.g.DB.Query(`UPDATE grilist.lists SET name = $2, description = $3 WHERE id = $1`, id, name, description) 439 _, err = m.g.DB.Query(`UPDATE grilist.lists SET name = $2, description = $3 WHERE id = $1`, id, name, description)