Remove unused session.Article attribute
This commit is contained in:
parent
13a6039490
commit
60e09175da
@ -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)}
|
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)
|
users, err := db.GetAllUsers(c)
|
||||||
if err != nil {
|
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)
|
http.Error(w, "Die Session ist abgelaufen. Bitte erneut anmelden.", http.StatusUnauthorized)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
session.Article = nil
|
|
||||||
|
|
||||||
article := &b.Article{
|
article := &b.Article{
|
||||||
Title: r.PostFormValue("article-title"),
|
Title: r.PostFormValue("article-title"),
|
||||||
|
@ -86,8 +86,6 @@ func ShowHub(c *b.Config, db *b.DB, s map[string]*Session) http.HandlerFunc {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
session.Article = nil
|
|
||||||
|
|
||||||
data := new(struct{ Role int })
|
data := new(struct{ Role int })
|
||||||
data.Role = session.User.Role
|
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)
|
http.Error(w, "Die Session ist abgelaufen. Bitte erneut anmelden.", http.StatusUnauthorized)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
session.Article = nil
|
|
||||||
|
|
||||||
article := &b.Article{
|
article := &b.Article{
|
||||||
Title: r.PostFormValue("issue-title"),
|
Title: r.PostFormValue("issue-title"),
|
||||||
|
@ -18,7 +18,6 @@ type Session struct {
|
|||||||
cancel context.CancelFunc
|
cancel context.CancelFunc
|
||||||
cookie *http.Cookie
|
cookie *http.Cookie
|
||||||
User *b.User
|
User *b.User
|
||||||
Article *b.Article
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func newSession(w http.ResponseWriter, c *b.Config, sessionExpiryChan chan<- string, user *b.User) *Session {
|
func newSession(w http.ResponseWriter, c *b.Config, sessionExpiryChan chan<- string, user *b.User) *Session {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user