Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

Commit

Permalink
Resolves #172
Browse files Browse the repository at this point in the history
Users can only see their own seasons within season selection, but can view matches within `/seasons` or whichever the link for it is.
  • Loading branch information
PhlexPlexico authored Nov 28, 2019
1 parent e697a78 commit 2f97870
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion get5/match.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,11 @@ def add_seasons(self):
self.season_selection.choices = []
season_tuples = []
season_tuples.append((0, 'No Season'))
for seasons in Season.query.filter((Season.end_date >= datetime.now()) | (Season.end_date.is_(None))).order_by(-Season.id):
if g.user.super_admin or g.user.admin:
ourSeasons = Season.query.filter((Season.end_date >= datetime.now()) | (Season.end_date.is_(None))).order_by(-Season.id)
else:
ourSeasons = Season.query.filter((Season.end_date >= datetime.now()) | (Season.end_date.is_(None))).filter(Season.user_id == g.user.id).order_by(-Season.id)
for seasons in :
season_tuples.append((seasons.id, seasons.name))
self.season_selection.choices += season_tuples

Expand Down

0 comments on commit 2f97870

Please sign in to comment.