Skip to content

Commit 61b7176

Browse files
authored
Merge pull request #224 from ComputerScienceHouse/co_op_student
Only allow current students to list co-ops
2 parents 2ae75fc + 70ce657 commit 61b7176

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

conditional/blueprints/co_op.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from conditional.models.models import CurrentCoops
66
from conditional.util.auth import get_user
77
from conditional.util.flask import render_template
8-
from conditional.util.ldap import ldap_is_eval_director
8+
from conditional.util.ldap import ldap_is_eval_director, ldap_is_current_student
99
from conditional.util.ldap import _ldap_add_member_to_group as ldap_add_member_to_group
1010
from conditional.util.ldap import _ldap_remove_member_from_group as ldap_remove_member_from_group
1111
from conditional.util.ldap import _ldap_is_member_of_group as ldap_is_member_of_group
@@ -42,6 +42,8 @@ def submit_co_op_form(user_dict=None):
4242
semester = post_data['semester']
4343
if post_data['semester'] not in valid_semesters:
4444
return "Invalid semester submitted", 400
45+
if not ldap_is_current_student(user_dict['account']):
46+
return "Must be current student", 403
4547

4648
log.info('Submit {} Co-Op'.format(semester))
4749

conditional/templates/nav.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="glyphicon glyphicon-list-alt"></span> Forms <span class="caret"></span></a>
2626
<ul class="dropdown-menu">
2727
<li><a href="/major_project"><span class="glyphicon glyphicon-star"></span> Major Project</a></li>
28+
{% if student %}
2829
<li><a href="/co_op"><span class="glyphicon glyphicon-briefcase"></span> Co-Op Submission</a></li>
30+
{% endif %}
2931
{% if is_intromember %}
3032
<li><a href="/intro_evals_form"><span class="glyphicon glyphicon-blackboard"></span> Introductory Evaluations</a></li>
3133
{% endif %}

0 commit comments

Comments
 (0)