Skip to content

Commit b579158

Browse files
committed
Upgrade PyLint and Freeze Dependencies
1 parent 8902487 commit b579158

File tree

5 files changed

+40
-25
lines changed

5 files changed

+40
-25
lines changed

conditional/blueprints/attendance.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ def get_seminar_attendees(meeting_id):
391391
user_name = request.headers.get('x-webauth-user')
392392
account = ldap_get_member(user_name)
393393
if not ldap_is_eboard(account):
394-
return "must be eboard", 403
394+
return jsonify({"success": False, "error": "Not EBoard"}), 403
395395

396396

397397
page = request.args.get('page', 1)
@@ -455,7 +455,7 @@ def alter_committee_attendance(cid):
455455

456456
account = ldap_get_member(user_name)
457457
if not ldap_is_eboard(account):
458-
return "must be eboard", 403
458+
return jsonify({"success": False, "error": "Not EBoard"}), 403
459459

460460
post_data = request.get_json()
461461
meeting_id = cid
@@ -488,7 +488,7 @@ def alter_seminar_attendance(sid):
488488

489489
account = ldap_get_member(user_name)
490490
if not ldap_is_eboard(account):
491-
return "must be eboard", 403
491+
return jsonify({"success": False, "error": "Not EBoard"}), 403
492492

493493
post_data = request.get_json()
494494
meeting_id = sid
@@ -528,15 +528,15 @@ def get_cm_attendees(sid):
528528
attendees.append(freshman)
529529
return jsonify({"attendees": attendees}), 200
530530

531-
elif request.method == 'DELETE':
531+
else:
532532
log = logger.new(request=request)
533533
log.info('Delete Technical Seminar {}'.format(sid))
534534

535535
user_name = request.headers.get('x-webauth-user')
536536

537537
account = ldap_get_member(user_name)
538538
if not ldap_is_eboard(account):
539-
return "must be eboard", 403
539+
return jsonify({"success": False, "error": "Not EBoard"}), 403
540540

541541
FreshmanSeminarAttendance.query.filter(
542542
FreshmanSeminarAttendance.seminar_id == sid).delete()
@@ -567,15 +567,15 @@ def get_ts_attendees(cid):
567567
attendees.append(freshman)
568568
return jsonify({"attendees": attendees}), 200
569569

570-
elif request.method == 'DELETE':
570+
else:
571571
log = logger.new(request=request)
572572
log.info('Delete Committee Meeting {}'.format(cid))
573573

574574
user_name = request.headers.get('x-webauth-user')
575575

576576
account = ldap_get_member(user_name)
577577
if not ldap_is_eboard(account):
578-
return "must be eboard", 403
578+
return jsonify({"success": False, "error": "Not EBoard"}), 403
579579

580580
FreshmanCommitteeAttendance.query.filter(
581581
FreshmanCommitteeAttendance.meeting_id == cid).delete()
@@ -599,7 +599,7 @@ def approve_cm(cid):
599599

600600
account = ldap_get_member(user_name)
601601
if not ldap_is_eboard(account):
602-
return "must be eboard", 403
602+
return jsonify({"success": False, "error": "Not EBoard"}), 403
603603

604604
CommitteeMeeting.query.filter(
605605
CommitteeMeeting.id == cid).first().approved = True
@@ -618,7 +618,7 @@ def approve_ts(sid):
618618

619619
account = ldap_get_member(user_name)
620620
if not ldap_is_eboard(account):
621-
return "must be eboard", 403
621+
return jsonify({"success": False, "error": "Not EBoard"}), 403
622622

623623
TechnicalSeminar.query.filter(
624624
TechnicalSeminar.id == sid).first().approved = True

conditional/blueprints/cache_management.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import signal
33
import structlog
44

5+
from flask import Blueprint, request, redirect
6+
57
from conditional.util.ldap import ldap_is_eval_director
68
from conditional.util.ldap import ldap_is_rtp
79

@@ -17,8 +19,6 @@
1719
from conditional.util.member import get_onfloor_members
1820

1921

20-
from flask import Blueprint, request, redirect
21-
2222
logger = structlog.get_logger()
2323
cache_bp = Blueprint('cache_bp', __name__)
2424

conditional/blueprints/major_project_submission.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
from flask import Blueprint, request, jsonify, redirect
44

5+
from sqlalchemy import desc
6+
57
from conditional.models.models import MajorProject
68

79
from conditional.util.ldap import ldap_is_eval_director
810
from conditional.util.ldap import ldap_get_member
911
from conditional.util.flask import render_template
1012

1113
from conditional import db, start_of_year
12-
from sqlalchemy import desc
1314

1415

1516
logger = structlog.get_logger()

conditional/util/ldap.py

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def _ldap_is_member_of_directorship(account, directorship):
3131
for director in directors:
3232
if director.uid == account.uid:
3333
return True
34+
return False
3435

3536

3637
@lru_cache(maxsize=1024)

requirements.txt

+26-13
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
1-
Flask
2-
itsdangerous
3-
Jinja2
4-
MarkupSafe
5-
csh_ldap
6-
SQLAlchemy
7-
Werkzeug
8-
structlog
9-
flask_sqlalchemy
10-
flask_migrate
11-
pylint
12-
#psycopg2
13-
raven[flask]
1+
alembic==0.9.6
2+
astroid==1.6.0
3+
blinker==1.4
4+
click==6.7
5+
csh-ldap==1.2.4.dev41
6+
Flask==0.12.2
7+
Flask-Migrate==2.1.1
8+
Flask-SQLAlchemy==2.3.2
9+
isort==4.2.15
10+
itsdangerous==0.24
11+
Jinja2==2.9.6
12+
lazy-object-proxy==1.3.1
13+
Mako==1.0.7
14+
MarkupSafe==1.0
15+
mccabe==0.6.1
16+
psycopg2==2.7.3.2
17+
pyldap==2.4.37
18+
pylint==1.8.1
19+
python-dateutil==2.6.1
20+
python-editor==1.0.3
21+
raven==6.3.0
22+
six==1.11.0
23+
SQLAlchemy==1.1.15
24+
structlog==17.2.0
25+
Werkzeug==0.12.2
26+
wrapt==1.10.11

0 commit comments

Comments
 (0)