The dashboard template uses .CSRFField inside a {{range .AppStats}} block. Inside the range, . refers to *handlers.AppStats, not the root template data map. Changed to $.CSRFField to reference the root context.
make check passes. docker build . succeeds.
The dashboard template uses `.CSRFField` inside a `{{range .AppStats}}` block. Inside the range, `.` refers to `*handlers.AppStats`, not the root template data map. Changed to `$.CSRFField` to reference the root context.
`make check` passes. `docker build .` succeeds.
--- FAIL: TestHandleDashboard/renders_dashboard_with_apps_without_crashing_on_CSRFField (0.01s)
handlers_test.go:422:
Error: Not equal: expected: 200, actual: 500
Messages: dashboard should not 500 when apps exist (CSRFField must be accessible)
handlers_test.go:423:
Error: "Internal Server Error\n" does not contain "csrf-test-app"
FAIL
Test PASSING after fix:
--- PASS: TestHandleDashboard/renders_dashboard_with_apps_without_crashing_on_CSRFField (0.01s)
PASS
ok git.eeqj.de/sneak/upaas/internal/handlers 0.248s
Linting, formatting, and build all pass:make check exits 0, docker build . succeeds.
**Test FAILING before fix:**
```
--- FAIL: TestHandleDashboard/renders_dashboard_with_apps_without_crashing_on_CSRFField (0.01s)
handlers_test.go:422:
Error: Not equal: expected: 200, actual: 500
Messages: dashboard should not 500 when apps exist (CSRFField must be accessible)
handlers_test.go:423:
Error: "Internal Server Error\n" does not contain "csrf-test-app"
FAIL
```
**Test PASSING after fix:**
```
--- PASS: TestHandleDashboard/renders_dashboard_with_apps_without_crashing_on_CSRFField (0.01s)
PASS
ok git.eeqj.de/sneak/upaas/internal/handlers 0.248s
```
**Linting, formatting, and build all pass:** `make check` exits 0, `docker build .` succeeds.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The dashboard template uses
.CSRFFieldinside a{{range .AppStats}}block. Inside the range,.refers to*handlers.AppStats, not the root template data map. Changed to$.CSRFFieldto reference the root context.make checkpasses.docker build .succeeds.Test Results
1. Failing test (test-only commit, before fix)
2. Passing test (after fix)
3.
make check— all passing4.
docker build .— successfix: add CSRFField to dashboard template data (closes #146)на Fix dashboard CSRFField crash (closes #146)Test FAILING before fix:
Test PASSING after fix:
Linting, formatting, and build all pass:
make checkexits 0,docker build .succeeds.