diff --git a/.gitignore b/.gitignore index 9c070ef..36a7e85 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +resumes config_hackWPI.py config.py # Created by https://www.gitignore.io/api/web,vim,git,macos,linux,bower,grunt,python,pycharm,windows,eclipse,webstorm,intellij,jetbrains,virtualenv,visualstudio,visualstudiocode diff --git a/flask_app.py b/flask_app.py index 265e382..a830d52 100644 --- a/flask_app.py +++ b/flask_app.py @@ -13,9 +13,6 @@ from email.mime.text import MIMEText from dateutil.relativedelta import relativedelta from flask import Flask, render_template, redirect, url_for, request, session, jsonify from flask_sqlalchemy import SQLAlchemy -from mailchimp3 import MailChimp -from pubnub.pnconfiguration import PNConfiguration -from pubnub.pubnub import PubNub from werkzeug.utils import secure_filename from config_hackWPI import api_keys, WAITLIST_LIMIT, HACKATHON_TIME, ALLOWED_EXTENSIONS @@ -25,13 +22,8 @@ app.config.from_pyfile('config.py') db = SQLAlchemy(app) -pnconfig = PNConfiguration() -pnconfig.publish_key = api_keys['pubnub']['pub'] -pnconfig.subscribe_key = api_keys['pubnub']['sub'] -pnconfig.ssl = True -pn = PubNub(pnconfig) class Hacker(db.Model): @@ -54,6 +46,14 @@ class AutoPromoteKeys(db.Model): key = db.Column(db.String(4096)) val = db.Column(db.String(4096)) +@app.errorhandler(413) +def filesize_too_big(erro): + print("Someone tried to send something too big") + return "That file was too big, please go back and try a smaller resume pdf" + +@app.errorhandler(500) +def server_error(): + print("There was a server error... If you're having trouble registering, please email hack@wpi.edu with your details and what you did to break our site :P") @app.route('/') def root(): @@ -154,7 +154,7 @@ def register(): print(session['mymlh']['first_name'] + " put on database successfully.") # Send a welcome email - msg = 'Hey ' + session['mymlh']['first_name'] + '\n\n' + msg = 'Dear ' + session['mymlh']['first_name'] + '\n\n' msg += 'Thanks for applying to Hack@WPI!\n' if waitlist: msg += 'Sorry! We have hit our registration capacity. You have been placed on the waitlist.\n' @@ -163,8 +163,6 @@ def register(): msg += 'You are fully registered! We will send you more info closer to the hackathon.\n' send_email(session['mymlh']['email'], 'Hack@WPI - Thanks for applying', msg) - pn.publish().channel('hackWPI-admin').message({'action': 'new_user'}).sync() - # Finally, send them to their dashboard return redirect(url_for('dashboard')) @@ -266,9 +264,6 @@ def change_admin(): db.session.query(Hacker).filter(Hacker.mlh_id == request.args.get('mlh_id')).update({'admin': False}) db.session.commit() - pn.publish().channel('hackWPI-admin').message( - {'status': 'success', 'action': 'change_admin:' + request.args.get('action'), 'more_info': '', - 'id': request.args.get('mlh_id')}).sync() return jsonify({'status': 'success', 'action': 'change_admin:' + request.args.get('action'), 'more_info': '', 'id': request.args.get('mlh_id')}) @@ -300,15 +295,11 @@ def check_in(): mlh_info = get_mlh_user(request.args.get('mlh_id')) # Send a welcome email... - msg = 'Hey ' + mlh_info['first_name'] + ',\n\n' + msg = 'Dear ' + mlh_info['first_name'] + ',\n\n' msg += 'Thanks for checking in!\n' msg += 'We will start shortly, please check your dashboard for updates!\n' send_email(mlh_info['email'], 'HackWPI - Thanks for checking in', msg) - pn.publish().channel('hackWPI-admin').message( - {'status': 'success', 'action': 'check_in', 'more_info': '', - 'id': request.args.get('mlh_id')}).sync() - return jsonify( {'status': 'success', 'action': 'check_in', 'more_info': '', 'id': request.args.get('mlh_id')}) @@ -355,11 +346,9 @@ def drop(): # Send a goodbye email... msg = 'Dear ' + mlh_info['first_name'] + ',\n\n' - msg += 'Your application was dropped, sorry to see you go.\n' + msg += 'Your application was dropped, sorry to see you go.\n If this was a mistake, you can re-register by going to hack.wpi.edu/register' send_email(mlh_info['email'], 'Hack@WPI - Application Dropped', msg) - pn.publish().channel('hackWPI-admin').message( - {'status': 'success', 'action': 'drop', 'more_info': '', 'id': request.args.get('mlh_id')}).sync() if is_self(request.args.get('mlh_id')): session.clear() @@ -411,9 +400,6 @@ def promote_from_waitlist(): msg += 'If you cannot make it, please remove yourself at hack.wpi.edu\dashboard.\n' send_email(mlh_info['email'], "Hack@WPI - You're off the Waitlist!", msg) - pn.publish().channel('hackWPI-admin').message( - {'status': 'success', 'action': 'promote_from_waitlist', 'more_info': '', - 'id': request.args.get('mlh_id')}).sync() print(mlh_info['first_name'] + "is off the waitlist!") @@ -463,7 +449,7 @@ def send_email(to, subject, body): print("Email sent to: " + to) body += '\nPlease let your friends know about the event as well!.\n' body += 'To update your status, you can go to hack.wpi.edu/dashboard\n' - body += '\nThanks Again!\nThe HackWPI Team\nhttps://twitter.com/hackwpi?lang=en' + body += '\nAll the best!\nThe HackWPI Team\nhttps://twitter.com/hackwpi?lang=en' server = smtplib.SMTP('smtp.gmail.com', 587) server.starttls() @@ -537,4 +523,4 @@ def allowed_file(filename): if __name__ == '__main__': - app.run(host='0.0.0.0', port=80) + app.run(host='0.0.0.0', port=80, threaded=True) diff --git a/manage_waitlist.py b/manage_waitlist.py index c4b532e..9710c71 100644 --- a/manage_waitlist.py +++ b/manage_waitlist.py @@ -50,5 +50,5 @@ msg += ' ' + str(errs) + '\n' print(msg) -send_email('hack@wpi.edu', 'HackWPI - Daily Waitlist Report!', msg) +#send_email('hack@wpi.edu', 'HackWPI - Daily Waitlist Report!', msg) send_email('bkayastha@wpi.edu', 'HackWPI - Daily Waitlist Report!', msg) diff --git a/requirements.txt b/requirements.txt index dd6b9a1..5ee67c2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,5 @@ pubnub==4.0.6 requests==2.13.0 Werkzeug==0.11.15 python_dateutil==2.6.0 +mysql-connector-python==8.0.5 +mysqlclient==1.3.12 diff --git a/static/img/nosponsors.png b/static/img/nosponsors.png new file mode 100644 index 0000000..c959073 Binary files /dev/null and b/static/img/nosponsors.png differ diff --git a/static/img/sponsors.png b/static/img/sponsors.png index c959073..9c5e8a5 100644 Binary files a/static/img/sponsors.png and b/static/img/sponsors.png differ diff --git a/static/img/sponsors.xcf b/static/img/sponsors.xcf new file mode 100644 index 0000000..ca76186 Binary files /dev/null and b/static/img/sponsors.xcf differ diff --git a/static/img/sponsors/Carbon_Black_Logo.png b/static/img/sponsors/Carbon_Black_Logo.png new file mode 100644 index 0000000..db60fbd Binary files /dev/null and b/static/img/sponsors/Carbon_Black_Logo.png differ diff --git a/static/img/sponsors/Orange Wakefly Logo 2015 Stacked.png b/static/img/sponsors/Orange Wakefly Logo 2015 Stacked.png new file mode 100644 index 0000000..35a105e Binary files /dev/null and b/static/img/sponsors/Orange Wakefly Logo 2015 Stacked.png differ diff --git a/static/img/sponsors/Vistaprint.jpg b/static/img/sponsors/Vistaprint.jpg new file mode 100644 index 0000000..ac9836d Binary files /dev/null and b/static/img/sponsors/Vistaprint.jpg differ diff --git a/templates/admin.html b/templates/admin.html index 4bda4af..6bb82d6 100644 --- a/templates/admin.html +++ b/templates/admin.html @@ -172,20 +172,23 @@ + - + + +
XXS XS S M LXLXXL
{{ shirt_count['xxs'] }} {{ shirt_count['xs'] }} {{ shirt_count['s'] }} {{ shirt_count['m'] }} {{ shirt_count['l'] }} {{ shirt_count['xl'] }}{{ shirt_count['xxl'] }}
diff --git a/templates/dashboard.html b/templates/dashboard.html index 2b9fa1d..0f41977 100644 --- a/templates/dashboard.html +++ b/templates/dashboard.html @@ -12,11 +12,11 @@

You are fully registered! We look forward to seeing you!

{% endif %}
-

Here are your available actions...

-

Drop Application :(

+

Drop Application :(

{% if admin %} -

Admin Dashboard

+

Admin Dashboard

{% endif %} +
Please sit tight, while we improve the UI of this page :P @@ -74,4 +74,4 @@ } -{% include 'footer.html' %} \ No newline at end of file +{% include 'footer.html' %} diff --git a/templates/footer.html b/templates/footer.html index 4ac04fe..028a60b 100644 --- a/templates/footer.html +++ b/templates/footer.html @@ -1,7 +1,7 @@ - - - - + + + + - - \ No newline at end of file + + diff --git a/templates/header.html b/templates/header.html index 73db160..fa1dc97 100644 --- a/templates/header.html +++ b/templates/header.html @@ -1,22 +1,22 @@ - - - - Hack @ WPI - - - - - - - - - + + + + Hack @ WPI + + + + + + + + + + diff --git a/templates/index.html b/templates/index.html index 9cf6efc..29d6d29 100755 --- a/templates/index.html +++ b/templates/index.html @@ -15,12 +15,6 @@
room WPI Odeum
- - Register Here! @@ -28,16 +22,16 @@
MLH Code + href="https://static.mlh.io/docs/mlh-code-of-conduct.pdf" data-mode="1" target="_blank">Code
- Slack Chatroom (TBA) +
- Devpost Link (TBA) +

@@ -141,7 +135,7 @@
Will there be travel reimbursements?
-

We are attempting to partner with some nearby schools to run a bus from there's to ours, but may not have the budget. If you're interested in providing a bus to our hackathon, let us know. At the moment we cannot provide travel reimburstments.

+

We are attempting to partner with some nearby schools to run a bus from their's to ours, but may not have the budget. If you're interested in providing a bus to our hackathon, let us know. At the moment we cannot provide travel reimbursments.

How do I know I'm registered?
@@ -149,7 +143,7 @@
I am officially registered but now I want to unregister, how do I do that?
-

Go to hack.wpi.edu/dashboard, there is a link on the bottom to drop your registration

+

Go to hack.wpi.edu/dashboard. There is a link on the bottom to drop your registration.

diff --git a/templates/register.html b/templates/register.html index 5ca1f48..a9a1ba9 100644 --- a/templates/register.html +++ b/templates/register.html @@ -11,33 +11,41 @@ Major League Hacking 2017 Hackathon Season
-

Hi {{ name }}, thanks for logging in with MyMLH!

-

If you'd like, add your resume to send to sponsors...

-
+

Hi {{ name }}, just a few more steps!

+
-
-
- File - -
-
- -
-
-

By registering & attending, you agree to the following policies:

-

MLH's Data Sharing - Notice -

-

MLH's Privacy Policy

-

- MLH's - Contest Terms and Conditions

-

MLH's Code of Conduct

-
-
- -
+
+

If you'd like, add your resume to send to sponsors...

+
+
+ File + +
+
+ +
+
+
+

By registering & attending, you agree to the following policies (We are no longer MLH afilliated, but we agree with their policies):

+

+ MLH's Data Sharing Notice +

+

+ MLH's Privacy Policy +

+

+ MLH's + Contest Terms and Conditions +

+

+ MLH's Code of Conduct +

+
+ +

+ +
-{% include 'footer.html' %} \ No newline at end of file +{% include 'footer.html' %}