Suppress "user not found" log when post not found

This also saves a user suspension check when a post isn't found.
pull/215/head
Matt Baer 5 years ago
parent 44a6703742
commit cfea887b78
  1. 5
      posts.go

@ -381,10 +381,13 @@ func handleViewPost(app *App, w http.ResponseWriter, r *http.Request) error {
}
}
suspended, err := app.db.IsUserSuspended(ownerID.Int64)
var suspended bool
if found {
suspended, err = app.db.IsUserSuspended(ownerID.Int64)
if err != nil {
log.Error("view post: %v", err)
}
}
// Check if post has been unpublished
if content == "" {

Loading…
Cancel
Save