|
|
@ -9,7 +9,6 @@ import ( |
|
|
|
"net/http" |
|
|
|
"net/http" |
|
|
|
"os" |
|
|
|
"os" |
|
|
|
"path/filepath" |
|
|
|
"path/filepath" |
|
|
|
"strconv" |
|
|
|
|
|
|
|
"strings" |
|
|
|
"strings" |
|
|
|
"time" |
|
|
|
"time" |
|
|
|
|
|
|
|
|
|
|
@ -86,7 +85,6 @@ func handleImport(app *App, u *User, w http.ResponseWriter, r *http.Request) err |
|
|
|
log.Error("invalid form data for file dates: %v", err) |
|
|
|
log.Error("invalid form data for file dates: %v", err) |
|
|
|
return impart.HTTPError{http.StatusBadRequest, "form data for file dates was invalid"} |
|
|
|
return impart.HTTPError{http.StatusBadRequest, "form data for file dates was invalid"} |
|
|
|
} |
|
|
|
} |
|
|
|
fileTZ := r.FormValue("tz") |
|
|
|
|
|
|
|
files := r.MultipartForm.File["files"] |
|
|
|
files := r.MultipartForm.File["files"] |
|
|
|
var fileErrs []error |
|
|
|
var fileErrs []error |
|
|
|
filesSubmitted := len(files) |
|
|
|
filesSubmitted := len(files) |
|
|
@ -149,12 +147,6 @@ func handleImport(app *App, u *User, w http.ResponseWriter, r *http.Request) err |
|
|
|
post.Collection = collAlias |
|
|
|
post.Collection = collAlias |
|
|
|
} |
|
|
|
} |
|
|
|
dateTime := time.Unix(fileDates[formFile.Filename], 0) |
|
|
|
dateTime := time.Unix(fileDates[formFile.Filename], 0) |
|
|
|
offset, err := strconv.Atoi(fileTZ) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
log.Error("form time zone offset not a valid integer: %v", err) |
|
|
|
|
|
|
|
continue |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
dateTime = dateTime.Add(time.Minute * time.Duration(offset)) |
|
|
|
|
|
|
|
post.Created = &dateTime |
|
|
|
post.Created = &dateTime |
|
|
|
created := post.Created.Format("2006-01-02T15:04:05Z") |
|
|
|
created := post.Created.Format("2006-01-02T15:04:05Z") |
|
|
|
submittedPost := SubmittedPost{ |
|
|
|
submittedPost := SubmittedPost{ |
|
|
|