Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_user_teams(user):
# This works only if no team mergers. The commented code below
# is general but slow.
team = Team.query.filter_by(name=user.name).one()
yield team
# teams = Team.query.all()
def get_user_event_teams(event_name, user_name):
# This works only if no team mergers. The commented code below
# is general but slow.
event = Event.query.filter_by(name=event_name).one()
team = Team.query.filter_by(name=user_name).one()
event_team = EventTeam.query.filter_by(
event=event, team=team).one_or_none()
if event_team is not None:
yield event_team
# event = Event.query.filter_by(name=event_name).one()