Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test with the Setup Setting Test #8

Open
cpapplefamily opened this issue Nov 30, 2024 · 0 comments
Open

Fix test with the Setup Setting Test #8

cpapplefamily opened this issue Nov 30, 2024 · 0 comments

Comments

@cpapplefamily
Copy link
Owner

This bit of code causes the test to fail but I am getting the desired functions

Particulary the "numAlliances, _ = strconv.Atoi(r.PostFormValue("numPlayoffAlliances"))" in the else section

var playoffType model.PlayoffType
	numAlliances := 0
	if r.PostFormValue("playoffType") == "SingleEliminationPlayoff" {
		playoffType = model.SingleEliminationPlayoff
		numAlliances, _ = strconv.Atoi(r.PostFormValue("numPlayoffAlliances"))
		if numAlliances < 2 || numAlliances > 16 {
			web.renderSettings(w, r, "Number of alliances must be between 2 and 16.")
			return
		}
	} else {
		playoffType = model.DoubleEliminationPlayoff
		numAlliances = 8
		log.Printf("setup_settings.go playoffType: %v", playoffType)
		log.Printf("setup_settings.go eventSettings.ElimType: double")
		numAlliances, _ = strconv.Atoi(r.PostFormValue("numPlayoffAlliances"))
		log.Printf("setup_settings.go numAlliances: %v", numAlliances)
		
		if  numAlliances < 3 || numAlliances > 8 {
			web.renderSettings(w, r, "Number of alliances For Double Must be between 3 and 8.")
			return
		}
	}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant