Skip to content

Commit

Permalink
FIX recent ides on admin/user page
Browse files Browse the repository at this point in the history
  • Loading branch information
wabscale committed Sep 12, 2022
1 parent 8df8112 commit 33101ca
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions api/anubis/ide/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from anubis.utils.data import is_debug


@cache.memoize(timeout=5, source_check=True)
def get_recent_sessions(user_id: str, limit: int = 10, offset: int = 10) -> list[dict]:
@cache.memoize(timeout=5, source_check=True, unless=is_debug)
def get_recent_sessions(user_id: str, limit: int = 10, offset: int = 0) -> list[dict]:
student = User.query.filter(
User.id == user_id,
).first()
Expand Down
2 changes: 1 addition & 1 deletion api/anubis/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ def data(self):
"last_updated": str(self.last_updated),
"autosave": self.autosave,
"persistent_storage": self.persistent_storage,
"image": self.image.data,
"image": self.image.data if self.image_id else None,
"image_tag": self.image_tag.data if self.image_tag_id else None,
}

Expand Down
4 changes: 2 additions & 2 deletions web/src/pages/core/admin/User.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ export default function User() {
),
},
{
field: 'image', headerName: 'Image', width: 100, renderCell: (params) => (params.value.title),
field: 'image', headerName: 'Image', width: 100, renderCell: (params) => (params.value?.title ?? ''),
},
{
field: 'image_tag', headerName: 'Image Tag', width: 120, renderCell: (params) => (
params.value || params.row.image.default_tag || 'latest'
params.value || params.row.image?.default_tag || 'latest'
),
},
{field: 'created', headerName: 'Start Time', width: 170},
Expand Down

0 comments on commit 33101ca

Please sign in to comment.