Remove unused session.Article attribute

This commit is contained in:
Jason Streifling 2025-01-14 21:31:57 +01:00
parent 13a6039490
commit 60e09175da
4 changed files with 4 additions and 14 deletions

View File

@ -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"),

View File

@ -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

View File

@ -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"),

View File

@ -18,7 +18,6 @@ type Session struct {
cancel context.CancelFunc
cookie *http.Cookie
User *b.User
Article *b.Article
}
func newSession(w http.ResponseWriter, c *b.Config, sessionExpiryChan chan<- string, user *b.User) *Session {