mirror of
https://github.com/writefreely/writefreely
synced 2024-11-10 11:24:13 +00:00
Merge pull request #212 from writeas/fix-suspension-check
Fix suspension check in fetchPost()
This commit is contained in:
commit
59d892e486
1 changed files with 1 additions and 3 deletions
4
posts.go
4
posts.go
|
@ -1039,7 +1039,6 @@ func pinPost(app *App, w http.ResponseWriter, r *http.Request) error {
|
||||||
|
|
||||||
func fetchPost(app *App, w http.ResponseWriter, r *http.Request) error {
|
func fetchPost(app *App, w http.ResponseWriter, r *http.Request) error {
|
||||||
var collID int64
|
var collID int64
|
||||||
var ownerID int64
|
|
||||||
var coll *Collection
|
var coll *Collection
|
||||||
var err error
|
var err error
|
||||||
vars := mux.Vars(r)
|
vars := mux.Vars(r)
|
||||||
|
@ -1055,14 +1054,13 @@ func fetchPost(app *App, w http.ResponseWriter, r *http.Request) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
collID = coll.ID
|
collID = coll.ID
|
||||||
ownerID = coll.OwnerID
|
|
||||||
}
|
}
|
||||||
|
|
||||||
p, err := app.db.GetPost(vars["post"], collID)
|
p, err := app.db.GetPost(vars["post"], collID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
suspended, err := app.db.IsUserSuspended(ownerID)
|
suspended, err := app.db.IsUserSuspended(p.OwnerID.Int64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("fetch post: %v", err)
|
log.Error("fetch post: %v", err)
|
||||||
return ErrInternalGeneral
|
return ErrInternalGeneral
|
||||||
|
|
Loading…
Reference in a new issue