Skip to content

Commit

Permalink
fix(html): resolve a bug with alerts
Browse files Browse the repository at this point in the history
It would fail to render the alert template if you tried to sign in
without providing any data. This fix just separates errors, but it's
more of a temporary workaround than a clear, good solution.
  • Loading branch information
vednoc committed Jul 12, 2021
1 parent 8f29262 commit 61ac607
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions views/partials/alert.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{{ if or .Error .Errors }}
<section class="err limit">
{{ if .Error }}
<p>{{ .Error }}</p>
{{ with .Error }}
<p>{{ . }}</p>
{{ end }}

{{ if .Errors }}
{{ with .Errors }}
<p>Validation failed!</p>
<ul>
{{ range .Errors }}
{{ if .Code }}
{{ range . }}
{{ if eq (printf "%T" .) "usercss.Error" }}
<li>{{ .Code }}</li>
{{ else }}
<li>{{ . }}</li>
Expand Down

0 comments on commit 61ac607

Please sign in to comment.