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: login form errors #982

Merged
merged 1 commit into from
Jan 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions src/unfold/templates/admin/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,20 @@ <h1 class="font-semibold mb-10">

{% include "unfold/helpers/messages.html" %}

{% include "unfold/helpers/messages/errornote.html" with errors=form.errors %}
<div class="flex flex-col gap-4 mb-8 *:mb-0">
{% include "unfold/helpers/messages/errornote.html" with errors=form.errors %}

{% include "unfold/helpers/messages/error.html" with errors=form.non_field_errors %}
{% include "unfold/helpers/messages/error.html" with errors=form.non_field_errors %}

{% if user.is_authenticated %}
{% blocktranslate trimmed asvar message %}
You are authenticated as {{ username }}, but are not authorized to
access this page. Would you like to login to a different account?
{% endblocktranslate %}
{% if user.is_authenticated %}
{% blocktranslate trimmed asvar message %}
You are authenticated as {{ username }}, but are not authorized to
access this page. Would you like to login to a different account?
{% endblocktranslate %}

{% include "unfold/helpers/messages/error.html" with error=message %}
{% endif %}
{% include "unfold/helpers/messages/error.html" with error=message %}
{% endif %}
</div>

{% block login_before %}{% endblock %}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% load i18n %}

{% if errors %}
<p class="errornote bg-red-100 mb-8 text-red-600 px-3 py-3 rounded text-sm dark:bg-red-500/20 dark:border-red-500/20 dark:text-red-500">
<p class="errornote bg-red-100 mb-8 text-red-700 px-3 py-3 rounded dark:bg-red-500/20 dark:border-red-500/20 dark:text-red-400">
{% if errors.items|length == 1 %}
{% translate "Please correct the error below." %}
{% else %}
Expand Down
Loading