diff --git a/database.go b/database.go index 3af659d..1ea9872 100644 --- a/database.go +++ b/database.go @@ -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 } diff --git a/posts.go b/posts.go index d4be947..2bd5f44 100644 --- a/posts.go +++ b/posts.go @@ -1299,7 +1299,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."} }