mirror of
https://github.com/writeas/writefreely
synced 2025-02-02 08:06:43 +01:00
Suppress "user not found" log when post not found
This also saves a user suspension check when a post isn't found.
This commit is contained in:
parent
44a6703742
commit
cfea887b78
9
posts.go
9
posts.go
@ -381,9 +381,12 @@ func handleViewPost(app *App, w http.ResponseWriter, r *http.Request) error {
|
||||
}
|
||||
}
|
||||
|
||||
suspended, err := app.db.IsUserSuspended(ownerID.Int64)
|
||||
if err != nil {
|
||||
log.Error("view post: %v", err)
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user