Improve viewable assistant logic (#4125)

* k

* quick fix

* k
This commit is contained in:
pablonyx 2025-02-26 17:24:39 -08:00 committed by GitHub
parent 4dc88ca037
commit a3e3d83b7e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -100,9 +100,14 @@ def _add_user_filters(
.correlate(Persona)
)
else:
where_clause |= Persona.is_public == True # noqa: E712
where_clause &= Persona.is_visible == True # noqa: E712
# Group the public persona conditions
public_condition = (Persona.is_public == True) & ( # noqa: E712
Persona.is_visible == True # noqa: E712
)
where_clause |= public_condition
where_clause |= Persona__User.user_id == user.id
where_clause |= Persona.user_id == user.id
return stmt.where(where_clause)