mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-17 02:05:22 -04:00
fix: gallery tag filters and tag-cleanup are empty in single-user mode (#1771)
This commit is contained in:
@@ -110,9 +110,17 @@ def _image_to_dict(img: GalleryImage, session_name: str = None) -> Dict[str, Any
|
||||
|
||||
|
||||
def _owner_filter(q, user):
|
||||
"""Apply owner filtering to a gallery query."""
|
||||
"""Apply owner filtering to a gallery query.
|
||||
|
||||
When auth is disabled (single-user mode) get_current_user returns None
|
||||
and there is no per-user scoping. The main library list and stats already
|
||||
treat None as "show everything" (`if user is not None`), so this helper
|
||||
must too — otherwise the tag/model filter sidebars come back empty and the
|
||||
tag-cleanup endpoints (clear-user-tags, clear-ai-tags, dedupe-tags)
|
||||
silently affect zero rows in the most common self-hosted deployment.
|
||||
"""
|
||||
if user is None:
|
||||
return q.filter(False)
|
||||
return q
|
||||
return q.filter(GalleryImage.owner == user)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user