mirror of
https://github.com/writefreely/writefreely
synced 2024-11-10 11:24:13 +00:00
Merge pull request #138 from writeas/fix-unpublished-state
Don't consider post unpublished when title exists
This commit is contained in:
commit
ba3cb4b4ff
2 changed files with 4 additions and 4 deletions
|
@ -926,7 +926,7 @@ func (db *datastore) GetEditablePost(id, editToken string) (*PublicPost, error)
|
|||
return nil, err
|
||||
}
|
||||
|
||||
if p.Content == "" {
|
||||
if p.Content == "" && p.Title.String == "" {
|
||||
return nil, ErrPostUnpublished
|
||||
}
|
||||
|
||||
|
@ -976,7 +976,7 @@ func (db *datastore) GetPost(id string, collectionID int64) (*PublicPost, error)
|
|||
return nil, err
|
||||
}
|
||||
|
||||
if p.Content == "" {
|
||||
if p.Content == "" && p.Title.String == "" {
|
||||
return nil, ErrPostUnpublished
|
||||
}
|
||||
|
||||
|
@ -1005,7 +1005,7 @@ func (db *datastore) GetOwnedPost(id string, ownerID int64) (*PublicPost, error)
|
|||
return nil, err
|
||||
}
|
||||
|
||||
if p.Content == "" {
|
||||
if p.Content == "" && p.Title.String == "" {
|
||||
return nil, ErrPostUnpublished
|
||||
}
|
||||
|
||||
|
|
2
posts.go
2
posts.go
|
@ -1309,7 +1309,7 @@ func viewCollectionPost(app *App, w http.ResponseWriter, r *http.Request) error
|
|||
p.IsTopLevel = app.cfg.App.SingleUser
|
||||
|
||||
// Check if post has been unpublished
|
||||
if p.Content == "" {
|
||||
if p.Content == "" && p.Title.String == "" {
|
||||
return impart.HTTPError{http.StatusGone, "Post was unpublished."}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue