Remove unused session.Article attribute
This commit is contained in:
		| @@ -54,11 +54,6 @@ func WriteArticle(c *b.Config, db *b.DB, s map[string]*Session) http.HandlerFunc | ||||
| 		} | ||||
|  | ||||
| 		data := &EditorHTMLData{Action: "submit", ArticleUsers: make(map[string]*ArticleUser)} | ||||
| 		if session.Article == nil { | ||||
| 			data.Article = new(b.Article) | ||||
| 		} else { | ||||
| 			data.Article = session.Article | ||||
| 		} | ||||
|  | ||||
| 		users, err := db.GetAllUsers(c) | ||||
| 		if err != nil { | ||||
| @@ -103,7 +98,6 @@ func SubmitArticle(c *b.Config, db *b.DB, s map[string]*Session) http.HandlerFun | ||||
| 			http.Error(w, "Die Session ist abgelaufen. Bitte erneut anmelden.", http.StatusUnauthorized) | ||||
| 			return | ||||
| 		} | ||||
| 		session.Article = nil | ||||
|  | ||||
| 		article := &b.Article{ | ||||
| 			Title:         r.PostFormValue("article-title"), | ||||
|   | ||||
| @@ -86,8 +86,6 @@ func ShowHub(c *b.Config, db *b.DB, s map[string]*Session) http.HandlerFunc { | ||||
| 			return | ||||
| 		} | ||||
|  | ||||
| 		session.Article = nil | ||||
|  | ||||
| 		data := new(struct{ Role int }) | ||||
| 		data.Role = session.User.Role | ||||
|  | ||||
|   | ||||
| @@ -18,7 +18,6 @@ func PublishLatestIssue(c *b.Config, db *b.DB, s map[string]*Session) http.Handl | ||||
| 			http.Error(w, "Die Session ist abgelaufen. Bitte erneut anmelden.", http.StatusUnauthorized) | ||||
| 			return | ||||
| 		} | ||||
| 		session.Article = nil | ||||
|  | ||||
| 		article := &b.Article{ | ||||
| 			Title:         r.PostFormValue("issue-title"), | ||||
|   | ||||
| @@ -14,11 +14,10 @@ import ( | ||||
| ) | ||||
|  | ||||
| type Session struct { | ||||
| 	ctx     context.Context | ||||
| 	cancel  context.CancelFunc | ||||
| 	cookie  *http.Cookie | ||||
| 	User    *b.User | ||||
| 	Article *b.Article | ||||
| 	ctx    context.Context | ||||
| 	cancel context.CancelFunc | ||||
| 	cookie *http.Cookie | ||||
| 	User   *b.User | ||||
| } | ||||
|  | ||||
| func newSession(w http.ResponseWriter, c *b.Config, sessionExpiryChan chan<- string, user *b.User) *Session { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user