fix(FastAPI): use elif statements where appropriate

Signed-off-by: Steven Guikal <void@fluix.one>
This commit is contained in:
Steven Guikal 2021-10-18 15:07:25 -04:00
parent 927f5e8567
commit db67e83bb8
3 changed files with 16 additions and 23 deletions

View file

@ -16,17 +16,16 @@
| safe
}}
</p>
{% elif request.user.is_authenticated() %}
<p>
{{ "Logged-in as: %s"
| tr
| format("<b>%s</b>" | format(request.user.Username))
| safe
}}
<a href="/logout/?next={{ next }}">[{% trans %}Logout{% endtrans %}]</a>
</p>
{% else %}
{% if request.user.is_authenticated() %}
<p>
{{ "Logged-in as: %s"
| tr
| format("<b>%s</b>" | format(request.user.Username))
| safe
}}
<a href="/logout/?next={{ next }}">[{% trans %}Logout{% endtrans %}]</a>
</p>
{% else %}
<form method="post" action="/login?next={{ next }}">
<fieldset>
<legend>{% trans %}Enter login credentials{% endtrans %}</legend>
@ -81,9 +80,7 @@
</fieldset>
</form>
{% endif %}
{% endif %}
</div>
{% endblock %}