commit f37ec5bf5dec8be69178c924e5dde5c936392dae parent 7e3fae0a44829ff34871fdc9fb7ad5a0f98f7e35 Author: Youth Employment Program Production <youthemployment22@gmail.com> Date: Wed, 1 May 2024 10:54:03 -0600 bugfix: display errors usefully Diffstat:
M | app/forms.py | | | 2 | +- |
M | app/templates/dashboard/punchclock/otheruser.html | | | 4 | ++-- |
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/forms.py b/app/forms.py @@ -68,7 +68,7 @@ class LessThan: } message = self.message if message is None: - message = field.gettext("Field must be less than %(other_name)s.") + message = field.gettext("Field must be less than %(other_label)s.") raise ValidationError(message % d) diff --git a/app/templates/dashboard/punchclock/otheruser.html b/app/templates/dashboard/punchclock/otheruser.html @@ -17,9 +17,9 @@ <table> {% for field in form %}{% if field.widget.input_type != 'hidden' and field.widget.input_type != 'submit' %} {% for error in field.errors %} - <span style="color:red;">[{{error}}]</span> + <tr><td><span style="color:red;">{{ field.label }}</span></td><td><span style="color:red;">[{{error}}]</span></td></tr> {% endfor %} - <tr><td>{{ field.label }}</td><td>{{ field }}</td></tr> + <tr><td>{{ field.label }}</td><td>{{ field }}</td></tr> {% endif %}{% endfor %} </table> {{ form.submitEntr() }}