litestar-org / litestar-org/litestar-fullstack

Bug: Recent activity area fails to load in Admin view

Open
#240 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
610
Forks
86
PR merge metrics
No merged PRs in 30d

Description

### Description

When logging in as Super Admin user, the "Recent Activity" area fails to load in the Admin view.

Relevant errors:
```
AttributeError: type object 'AuditLog' has no attribute 'limit'

The above exception was the direct cause of the following exception:

╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /home/static/dev-wsl/admin-portal/.venv/lib/python3.13/site-packages/litesta │
│ r/middleware/_internal/exceptions/middleware.py:158 in __call__ │
│ │
│ 155 │ │ │ await send(event) │
│ 156 │ │ │
│ 157 │ │ try: │
│ ❱ 158 │ │ │ await self.app(scope, receive, capture_response_started) │
│ 159 │ │ except Exception as e: │
│ 160 │ │ │ if scope_state.response_started: │
│ 161 │ │ │ │ raise LitestarException("Exception caught after respon │
│ e │
│ │
│ /home/static/dev-wsl/admin-portal/.venv/lib/python3.13/site-packages/litesta │
│ r/routes/http.py:81 in handle │
│ │
│ 78 │ │ │ await route_handler.authorize_connection(connection=reques │
│ 79 │ │ │
│ 80 │ │ try: │
│ ❱ 81 │ │ │ response = await self._get_response_for_request( │
│ 82 │ │ │ │ scope=scope, request=request, route_handler=route_hand │
│ parameter_model=parameter_model │
│ 83 │ │ │ ) │
│ 84 │
│ │
│ ... 8 frames hidden ... │
│ │
│ /home/static/.local/share/uv/python/cpython-3.13.7-linux-x86_64-gnu/lib/pyth │
│ on3.13/contextlib.py:162 in __exit__ │
│ │
│ 159 │ │ │ │ # tell if we get the same exception back │
│ 160 │ │ │ │ value = typ() │
│ 161 │ │ │ try: │
│ ❱ 162 │ │ │ │ self.gen.throw(value) │
│ 163 │ │ │ except StopIteration as exc: │
│ 164 │ │ │ │ # Suppress StopIteration *unless* it's the same except │
│ 165 │ │ │ │ # was passed to throw(). This prevents a StopIteratio │
│ │
│ /home/static/dev-wsl/admin-portal/.venv/lib/python3.13/site-packages/advance │
│ d_alchemy/exceptions.py:350 in wrap_sqlalchemy_exception │
│ │
│ 347 │ │ │ msg = _get_error_message(error_messages=error_messages, ke │
│ exc=exc) │
│ 348 │ │ else: │
│ 349 │ │ │ msg = f"An attribute error occurred during processing: {ex │
│ ❱ 350 │ │ raise RepositoryError(detail=msg) from exc │
│ 351 │
╰──────────────────────────────────────────────────────────────────────────────╯
RepositoryError: There was an error during data processing
```

### Package Version

Fullstack demo v0.3, LITESTAR 2.19.0

### Platform

- [x] Linux
- [ ] Mac
- [ ] Windows
- [ ] Other (Please specify in the description above)

Contributor guide

Open the contributing guide

Research direction

Start in the Admin view's Recent Activity path and trace how the AuditLog query is built for a Super Admin, using the reported AttributeError as the entry point. Reproduce the failure on the Fullstack demo v0.3 and verify that the Recent Activity area loads without the RepositoryError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, sqlalchemy
Domain
backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.