-
Notifications
You must be signed in to change notification settings - Fork 33
Packet 3.5 #208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Packet 3.5 #208
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
2a752dd
Adding 500 and 404 pages
devinmatte d8244e3
Fixing linting issues
devinmatte 96fbe3e
Merge Custom Error Pages (#200)
mxmeinhold 44076e3
Add pylint_quotes and pylint/routes to readme
mxmeinhold 2b92c8e
Update pylint task in gulp
mxmeinhold 31a6ad1
Add docker build to travis
mxmeinhold 0fa696a
Move pylint to grunt lint task
mxmeinhold 6e1265e
Update pylint command, ci for docker build (#202)
mxmeinhold ce7d037
Move stats methods to stats.py
mxmeinhold 68e4dd3
Create packet aggregate signatures graph
mxmeinhold 7db9966
Add links from packet to graphs and back
mxmeinhold 176d31a
Initial Admin UI
devinmatte c94a2d5
Adding sync command that works, and functioning admin pages
devinmatte b9c3a6d
Merge pull request #205 from mxmeinhold/stats
mxmeinhold 6c94112
Fixing for frosh
devinmatte e32a904
Fixing pylint
devinmatte e1ab5a3
Merge remote-tracking branch 'upstream/develop' into admin_ui
devinmatte 4a900d9
Fixing pylint error
devinmatte b562c5e
Merge pull request #206 from devinmatte/admin_ui
devinmatte 84fa5d5
Fixing api, adding sync
devinmatte da53e55
Merge pull request #207 from devinmatte/admin_ui_fixes
mxmeinhold b29e178
Bump lodash from 4.17.15 to 4.17.19 (#204)
dependabot[bot] 79afcbd
Fixing UI
devinmatte c38c8e9
Bump to 3.5.0
mxmeinhold e95ad53
Yarn upgrade
devinmatte 77c248c
Admin for evals only
devinmatte 3a4d8e2
Remove unused ldap_is_rtp import from utils
mxmeinhold File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,16 @@ | ||
| language: python | ||
| python: | ||
| - "3.7" | ||
| services: | ||
| - "docker" | ||
|
|
||
| install: | ||
| - "pip install -r requirements.txt" | ||
| - "curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.35.3/install.sh | bash" | ||
| - "nvm install" | ||
| - "nvm use" | ||
| - "npm install -g gulp" | ||
| - "npm install" | ||
| script: | ||
| - "pylint --load-plugins pylint_quotes packet/routes packet" | ||
| - "gulp lint" | ||
| - "docker build -t packet ." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| pre{ | ||
| white-space: pre-wrap; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| from flask import render_template | ||
|
|
||
| from packet import app | ||
| from packet.models import Packet, Freshman | ||
| from packet.routes.shared import packet_sort_key | ||
| from packet.utils import before_request, packet_auth, admin_auth | ||
| from packet.log_utils import log_cache, log_time | ||
|
|
||
|
|
||
| @app.route('/admin/packets') | ||
| @log_cache | ||
| @packet_auth | ||
| @admin_auth | ||
| @before_request | ||
| @log_time | ||
|
Comment on lines
+10
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is getting to be a lot of decorators. I'd consider refactoring the auth and logging ones to be function-style decorators so you can make things more compact and readable. Maybe something like this: @app.route('/admin/packets')
@with_logs(TIME, CACHE)
@require_auth(ADMIN, PACKET)
@before_request |
||
| def admin_packets(info=None): | ||
| open_packets = Packet.open_packets() | ||
|
|
||
| # Pre-calculate and store the return values of did_sign(), signatures_received(), and signatures_required() | ||
| for packet in open_packets: | ||
| packet.did_sign_result = packet.did_sign(info['uid'], app.config['REALM'] == 'csh') | ||
| packet.signatures_received_result = packet.signatures_received() | ||
| packet.signatures_required_result = packet.signatures_required() | ||
|
|
||
| open_packets.sort(key=packet_sort_key, reverse=True) | ||
|
|
||
| return render_template('admin_packets.html', | ||
| open_packets=open_packets, | ||
| info=info) | ||
|
|
||
|
|
||
| @app.route('/admin/freshmen') | ||
| @log_cache | ||
| @packet_auth | ||
| @admin_auth | ||
| @before_request | ||
| @log_time | ||
| def admin_freshmen(info=None): | ||
| all_freshmen = Freshman.get_all() | ||
|
|
||
| return render_template('admin_freshmen.html', | ||
| all_freshmen=all_freshmen, | ||
| info=info) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if the couple of characters saved by this helper method is worth the extra level of abstraction/indirection. Not a big deal either way though.