Make issue compatible with multiple authors
This commit is contained in:
parent
8fb0733908
commit
8d41caf40a
@ -33,7 +33,6 @@ func PublishLatestIssue(c *b.Config, db *b.DB, s *b.CookieStore) http.HandlerFun
|
|||||||
Published: true,
|
Published: true,
|
||||||
Rejected: false,
|
Rejected: false,
|
||||||
Created: time.Now(),
|
Created: time.Now(),
|
||||||
AuthorID: session.Values["id"].(int64),
|
|
||||||
AutoGenerated: true,
|
AutoGenerated: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,6 +48,22 @@ func PublishLatestIssue(c *b.Config, db *b.DB, s *b.CookieStore) http.HandlerFun
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
authorIDs := make([]int64, 1)
|
||||||
|
var ok bool
|
||||||
|
|
||||||
|
if authorIDs[0], ok = session.Values["id"].(int64); !ok {
|
||||||
|
msg := "fälschlicherweise session.Values[\"id\"].(int64) für authorIDs[0] angenommen"
|
||||||
|
log.Println(msg)
|
||||||
|
http.Error(w, msg, http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if err = db.WriteArticleAuthors(article.ID, authorIDs); err != nil {
|
||||||
|
log.Println(err)
|
||||||
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
content := []byte(r.PostFormValue("issue-content"))
|
content := []byte(r.PostFormValue("issue-content"))
|
||||||
if len(content) == 0 {
|
if len(content) == 0 {
|
||||||
http.Error(w, "Bitte eine Beschreibung eingeben.", http.StatusBadRequest)
|
http.Error(w, "Bitte eine Beschreibung eingeben.", http.StatusBadRequest)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user