Skip to content

Commit 8f63f56

Browse files
authored
List sessions for user where user is a speaker but not creator (fossasia#5568)
1 parent 86c08bb commit 8f63f56

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/api/sessions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ def query(self, view_kwargs):
8787
query_ = query_.join(Microlocation).filter(Microlocation.id == microlocation.id)
8888
if view_kwargs.get('user_id') is not None:
8989
user = safe_query(self, User, 'id', view_kwargs['user_id'], 'user_id')
90-
query_ = query_.join(User).filter(User.id == user.id)
90+
query_ = query_.join(User)\
91+
.join(Speaker).filter((User.id == user.id or Session.speakers.any(Speaker.user_id == user.id)))
9192
query_ = event_query(self, query_, view_kwargs)
9293
if view_kwargs.get('speaker_id'):
9394
speaker = safe_query(self, Speaker, 'id', view_kwargs['speaker_id'], 'speaker_id')

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy