diff --git a/cmd/frontend/articles.go b/cmd/frontend/articles.go index 9a7292d..d88bf33 100644 --- a/cmd/frontend/articles.go +++ b/cmd/frontend/articles.go @@ -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"), diff --git a/cmd/frontend/homepage.go b/cmd/frontend/homepage.go index 9245b8d..3e41905 100644 --- a/cmd/frontend/homepage.go +++ b/cmd/frontend/homepage.go @@ -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 diff --git a/cmd/frontend/issues.go b/cmd/frontend/issues.go index 430e6b9..f40450d 100644 --- a/cmd/frontend/issues.go +++ b/cmd/frontend/issues.go @@ -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"), diff --git a/cmd/frontend/sessions.go b/cmd/frontend/sessions.go index 105b5d3..4b1dcc8 100644 --- a/cmd/frontend/sessions.go +++ b/cmd/frontend/sessions.go @@ -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 {