diff options
-rw-r--r-- | modules/lists/lists.go | 9 |
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) |