Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion conditional/blueprints/slideshow.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from conditional.util.auth import get_user
from conditional.util.flask import render_template
from conditional.util.ldap import ldap_is_eval_director, ldap_is_intromember, ldap_set_failed, ldap_set_bad_standing, \
ldap_set_inactive, ldap_get_member, ldap_set_not_intro_member
ldap_set_inactive, ldap_get_member, ldap_set_not_intro_member, ldap_get_housingpoints, ldap_set_housingpoints

logger = structlog.get_logger()

Expand Down Expand Up @@ -136,6 +136,7 @@ def slideshow_spring_review(user_dict=None):
if status == "Passed":
if ldap_is_intromember(account):
ldap_set_not_intro_member(account)
ldap_set_housingpoints(account, ldap_get_housingpoints(account) + 2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

future: do we have handling of success/failure in ldap operations to give evals/rtps a list at the end of "here's all the results that need to be fixed"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we have that anywhere. I think a new issue is in order for that

elif status == "Failed":
if ldap_is_intromember(account):
ldap_set_failed(account)
Expand Down
6 changes: 6 additions & 0 deletions conditional/util/ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ def ldap_is_current_student(account):
return _ldap_is_member_of_group(account, 'current_student')


def ldap_get_housingpoints(account):
try:
return account.housingPoints
except AttributeError:
return 0

def ldap_set_housingpoints(account, housing_points):
account.housingPoints = housing_points
ldap_get_current_students.cache_clear()
Expand Down