Skip to content

Commit

Permalink
Merge pull request #78 from devinmatte/hotfix_freshmen
Browse files Browse the repository at this point in the history
Hotfix freshman page
  • Loading branch information
devinmatte authored Sep 10, 2018
2 parents 93bb364 + ae4a351 commit a63c060
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 0 additions & 2 deletions packet/packet.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,10 @@ def valid_signature(signer_username, freshman_username):
return True


@lru_cache(maxsize=512)
def get_freshman(freshman_username):
return Freshman.query.filter_by(rit_username=freshman_username).first()


@lru_cache(maxsize=512)
def get_current_packet(freshman_username):
return get_freshman(freshman_username).current_packet()

Expand Down
7 changes: 4 additions & 3 deletions packet/routes/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
from flask import render_template, redirect

from packet import auth, app
from packet.models import Freshman, Packet
from packet.packet import get_signatures, get_number_required, get_number_signed, get_upperclassmen_percent
from packet.models import Packet
from packet.packet import get_signatures, get_number_required, get_number_signed, get_upperclassmen_percent, \
get_freshman
from packet.utils import before_request, signed_packet


Expand All @@ -19,7 +20,7 @@ def logout():
@auth.oidc_auth
@before_request
def freshman_packet(uid, info=None):
freshman = Freshman.query.filter_by(rit_username=uid).first()
freshman = get_freshman(uid)
upperclassmen_percent = get_upperclassmen_percent(uid)
signatures = get_signatures(uid)
signed_dict = get_number_signed(uid)
Expand Down

0 comments on commit a63c060

Please sign in to comment.