Skip to content
Open
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
6 changes: 6 additions & 0 deletions fastapi_admin/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ async def get_inputs(cls, request: Request, obj: Optional[TortoiseModel] = None)
value = str(getattr(obj, name, None))
ret.append(await input_.render(request, value))
continue
if (
isinstance(input_, inputs.ManyToMany)
and (obj is not None)
and name in obj._meta.m2m_fields
):
await obj.fetch_related(name)
ret.append(await input_.render(request, getattr(obj, name, None)))
return ret

Expand Down
2 changes: 1 addition & 1 deletion fastapi_admin/templates/errors/401.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
We are sorry but the page you are looking for need authorization.
</p>
<div class="empty-action">
<a href="{{ request.app.admin_path }}" class="btn btn-primary">
<a href="{{ request.app.admin_path }}/login" class="btn btn-primary">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24"
stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"
stroke-linejoin="round">
Expand Down
12 changes: 6 additions & 6 deletions fastapi_admin/templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ <h1 class="navbar-brand navbar-brand-autodark">
</h1>
{% endif %}
<button
class="navbar-toggler"
type="button"
data-bs-toggle="collapse"
data-bs-target="#navbar-menu"
class="navbar-toggler"
type="button"
data-bs-toggle="collapse"
data-bs-target="#navbar-menu"
>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbar-menu">
<ul class="navbar-nav pt-lg-3">
{% for resource in resources %} {% if resource.type == 'link' %}
Expand All @@ -36,8 +38,6 @@ <h1 class="navbar-brand navbar-brand-autodark">
class="navbar navbar-expand-md navbar-light d-none d-lg-flex d-print-none"
>
<div class="container-fluid">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-nav flex-row order-md-last">
{% if request.app.language_switch %}
{% include "components/language.html" %}
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ version = "1.0.5"
[tool.poetry.dependencies]
Babel = "*"
aiofiles = "*"
redis = "^4.2.0rc1"
redis = "^5.0.0"
bcrypt = "*"
fastapi = "*"
jinja2 = "*"
Expand Down