Coverage for app/controllers/minor/routes.py: 57%
37 statements
« prev ^ index » next coverage.py v7.2.7, created at 2024-02-15 21:27 +0000
« prev ^ index » next coverage.py v7.2.7, created at 2024-02-15 21:27 +0000
1from flask import Flask, g, render_template, request, abort
2from app.logic.minor import updateMinorInterest, getProgramEngagementHistory, getCourseInformation
3from app.models.user import User
4from app.controllers.minor import minor_bp
5from app.logic.minor import getCommunityEngagementByTerm
7@minor_bp.route('/profile/<username>/cceMinor', methods=['GET'])
8def viewCceMinor(username):
9 """
10 Load minor management page with community engagements and summer experience
11 """
12 if not (g.current_user.isAdmin):
13 return abort(403)
14 terms = getCommunityEngagementByTerm(username)
15 user = User.get_by_id(username)
16 return render_template("minor/profile.html",
17 user=user,
18 terms=terms)
20@minor_bp.route('/cceMinor/<username>/identifyCommunityEngagement/<term>', methods=['GET'])
21def identifyCommunityEngagement(username):
22 """
23 Load all program and course participation records for that term
24 """
25 pass
27@minor_bp.route('/cceMinor/<username>/getEngagementInformation/<type>/<term>/<id>', methods=['GET'])
28def getEngagementInformation(username, type, id, term):
29 """
30 For a particular engagement activity (program or course), get the participation history or course information respectively.
31 """
32 if type == "program":
33 information = getProgramEngagementHistory(id, username, term)
34 else:
35 information = getCourseInformation(id)
37 return information
39@minor_bp.route('/cceMinor/<username>/addCommunityEngagement', methods=['POST'])
40def addCommunityEngagement(username):
41 """
42 Saving a term participation/activities for sustained community engagement
43 """
44 pass
46@minor_bp.route('/cceMinor/<username>/removeCommunityEngagement', methods=['POST'])
47def removeCommunityEngagement(username):
48 """
49 Opposite of above
50 """
51 pass
53@minor_bp.route('/cceMinor/<username>/requestOtherCommunityEngagement', methods=['GET,POST'])
54def requestOtherCommunityEngagement(username):
55 """
56 Load the "request other" form and submit it.
57 """
58 pass
60@minor_bp.route('/cceMinor/<username>/addSummerExperience', methods=['POST'])
61def addSummerExperience(username):
62 pass
64@minor_bp.route('/cceMinor/<username>/indicateInterest', methods=['POST'])
65def indicateMinorInterest(username):
66 updateMinorInterest(username)
67 return ""