Don't throw error if it is not a draft

pull/166/head
Henrique Dias 2017-07-27 13:30:46 +01:00
parent fbd0cf0c14
commit 8a4e1b6520
No known key found for this signature in database
GPG Key ID: 936F5EB68D786730
1 changed files with 1 additions and 1 deletions

View File

@ -110,7 +110,7 @@ func (h hugo) BeforeAPI(c *filemanager.RequestContext, w http.ResponseWriter, r
// We only run undraft command if it is a file.
if !strings.HasSuffix(filename, "/") {
args := []string{"undraft", filename}
if err := Run(h.Exe, args, h.Root); err != nil {
if err := Run(h.Exe, args, h.Root); err != nil && !strings.Contains(err.Error(), "not a Draft") {
return http.StatusInternalServerError, err
}
}