forked from jason/cpolis
		
	Make issue compatible with multiple authors
This commit is contained in:
		@@ -33,7 +33,6 @@ func PublishLatestIssue(c *b.Config, db *b.DB, s *b.CookieStore) http.HandlerFun
 | 
			
		||||
			Published:     true,
 | 
			
		||||
			Rejected:      false,
 | 
			
		||||
			Created:       time.Now(),
 | 
			
		||||
			AuthorID:      session.Values["id"].(int64),
 | 
			
		||||
			AutoGenerated: true,
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
@@ -49,6 +48,22 @@ func PublishLatestIssue(c *b.Config, db *b.DB, s *b.CookieStore) http.HandlerFun
 | 
			
		||||
			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"))
 | 
			
		||||
		if len(content) == 0 {
 | 
			
		||||
			http.Error(w, "Bitte eine Beschreibung eingeben.", http.StatusBadRequest)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user