mirror of
https://github.com/Eggbertx/gochan.git
synced 2025-08-04 16:16:22 -07:00
Fix changes suggested by sqlclosecheck
This commit is contained in:
parent
27a0142864
commit
1032042472
12 changed files with 87 additions and 27 deletions
|
@ -425,10 +425,9 @@ func reportsCallback(_ http.ResponseWriter, request *http.Request, staff *gcsql.
|
|||
dismissID := gcutil.HackyStringToInt(dismissIDstr)
|
||||
block := request.FormValue("block")
|
||||
if block != "" && staff.Rank != 3 {
|
||||
errEv.
|
||||
errEv.Caller().
|
||||
Int("postID", dismissID).
|
||||
Str("rejected", "not an admin").
|
||||
Caller().Send()
|
||||
Str("rejected", "not an admin").Send()
|
||||
return "", errors.New("only the administrator can block reports")
|
||||
}
|
||||
found, err := gcsql.ClearReport(dismissID, staff.ID, block != "" && staff.Rank == 3)
|
||||
|
|
|
@ -26,6 +26,7 @@ func getAllAnnouncements() ([]announcementWithName, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var announcements []announcementWithName
|
||||
for rows.Next() {
|
||||
var announcement announcementWithName
|
||||
|
|
|
@ -77,10 +77,10 @@ func createSession(key, username, password string, request *http.Request, writer
|
|||
})
|
||||
|
||||
if err = staff.CreateLoginSession(key); err != nil {
|
||||
gcutil.LogError(err).
|
||||
errEv.Err(err).Caller().
|
||||
Str("staff", username).
|
||||
Str("sessionKey", key).
|
||||
Caller().Msg("Error creating new staff session")
|
||||
Msg("Error creating new staff session")
|
||||
return ErrUnableToCreateSession
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue