mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 13:46:44 -04:00
Fix possible edge case
Fixes the possible edge case where submitting the fourm but not setting an event name would clear the event name.
This commit is contained in:
committed by
Patrick Fairbank
parent
9717c17765
commit
7bcfea4aaa
@@ -33,7 +33,13 @@ func (web *Web) settingsPostHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
eventSettings := web.arena.EventSettings
|
eventSettings := web.arena.EventSettings
|
||||||
|
|
||||||
|
previousName = eventSettings.Name
|
||||||
eventSettings.Name = r.PostFormValue("name")
|
eventSettings.Name = r.PostFormValue("name")
|
||||||
|
if len(eventSettings.Name) < 1 && perviousName == "Untitled Event"{
|
||||||
|
eventSettings.Name = "Untitled Event"
|
||||||
|
}
|
||||||
|
|
||||||
numAlliances, _ := strconv.Atoi(r.PostFormValue("numElimAlliances"))
|
numAlliances, _ := strconv.Atoi(r.PostFormValue("numElimAlliances"))
|
||||||
if numAlliances < 2 || numAlliances > 16 {
|
if numAlliances < 2 || numAlliances > 16 {
|
||||||
web.renderSettings(w, r, "Number of alliances must be between 2 and 16.")
|
web.renderSettings(w, r, "Number of alliances must be between 2 and 16.")
|
||||||
|
|||||||
Reference in New Issue
Block a user