|
1 |
| -from conditional.util.context_processors import get_member_name |
2 |
| -import structlog |
3 |
| -import os |
4 |
| - |
5 | 1 | from flask import Blueprint
|
6 | 2 | from flask import request
|
7 | 3 | from flask import jsonify
|
8 | 4 | from flask import redirect
|
9 |
| - |
10 |
| -from conditional import app |
11 |
| -from conditional import context_processors |
12 | 5 | import requests
|
13 | 6 | import json
|
14 | 7 |
|
15 | 8 | from sqlalchemy import desc
|
16 | 9 |
|
| 10 | +import structlog |
| 11 | + |
| 12 | +from conditional.util.context_processors import get_member_name |
| 13 | + |
17 | 14 | from conditional.models.models import MajorProject
|
18 | 15 |
|
19 | 16 | from conditional.util.ldap import ldap_is_eval_director
|
20 | 17 | from conditional.util.ldap import ldap_get_member
|
21 | 18 | from conditional.util.flask import render_template
|
22 | 19 |
|
23 |
| -from conditional import db, start_of_year, get_user, auth |
| 20 | +from conditional import db, start_of_year, get_user, auth, app |
24 | 21 |
|
25 | 22 | logger = structlog.get_logger()
|
26 | 23 |
|
@@ -71,7 +68,9 @@ def submit_major_project(user_dict=None):
|
71 | 68 | return jsonify({"success": False}), 400
|
72 | 69 | project = MajorProject(user_dict['username'], name, description)
|
73 | 70 |
|
74 |
| - send_slack_ping({"text":f"<!subteam^S5XENJJAH> *{get_member_name(user_dict['username'])}* ({user_dict['username']}) submitted their major project, *{name}*!"}) |
| 71 | + username = user_dict['username'] |
| 72 | + send_slack_ping({"text":f"<!subteam^S5XENJJAH> *{get_member_name(username)}* ({username})\n" |
| 73 | + f" submitted their major project, *{name}*!"}) |
75 | 74 | db.session.add(project)
|
76 | 75 | db.session.commit()
|
77 | 76 | return jsonify({"success": True}), 200
|
|
0 commit comments