Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't Show LOAs more than a year in the future #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions yogsite/modules/admin/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ def page_loa():
form_set_loa = SetLOAForm(request.form, prefix="form_set_loa")

loas = db.game_db.query(db.LOA).filter(
db.LOA.expiry_time > (datetime.utcnow() - timedelta(days=30)).date()
).order_by(db.LOA.id.desc()) # Get LOAs sorted by start time
and_(
db.LOA.expiry_time > (datetime.utcnow() + timedelta(years=1)).date(),
db.LOA.expiry_time > (datetime.utcnow() - timedelta(days=30)).date()
)
).order_by(db.LOA.id.desc()) # Get LOAs sorted by start time

if not g.current_user.has_perms("loa.others"):
loas = loas.filter(db.LOA.ckey == g.current_user.ckey)
Expand Down