Skip to content

Commit 8004ff0

Browse files
authored
Merge pull request #110 from mxmeinhold/remove-essays
Removes the essays
2 parents a8b90f7 + ef47ae6 commit 8004ff0

File tree

5 files changed

+33
-80
lines changed

5 files changed

+33
-80
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
"""Remove essays
2+
3+
Revision ID: fe83600ef3fa
4+
Revises: 0eeabc7d8f74
5+
Create Date: 2018-10-22 21:55:15.257440
6+
7+
"""
8+
from alembic import op
9+
import sqlalchemy as sa
10+
11+
12+
# revision identifiers, used by Alembic.
13+
revision = 'fe83600ef3fa'
14+
down_revision = '0eeabc7d8f74'
15+
branch_labels = None
16+
depends_on = None
17+
18+
19+
def upgrade():
20+
# ### commands auto generated by Alembic - please adjust! ###
21+
op.drop_column('packet', 'info_events')
22+
op.drop_column('packet', 'info_eboard')
23+
op.drop_column('packet', 'info_achieve')
24+
# ### end Alembic commands ###
25+
26+
27+
def downgrade():
28+
# ### commands auto generated by Alembic - please adjust! ###
29+
op.add_column('packet', sa.Column('info_achieve', sa.TEXT(), autoincrement=False, nullable=True))
30+
op.add_column('packet', sa.Column('info_eboard', sa.TEXT(), autoincrement=False, nullable=True))
31+
op.add_column('packet', sa.Column('info_events', sa.TEXT(), autoincrement=False, nullable=True))
32+
# ### end Alembic commands ###

packet/models.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from datetime import datetime
66
from itertools import chain
77

8-
from sqlalchemy import Column, Integer, String, Text, ForeignKey, DateTime, Boolean
8+
from sqlalchemy import Column, Integer, String, ForeignKey, DateTime, Boolean
99
from sqlalchemy.orm import relationship
1010

1111
from . import db
@@ -50,9 +50,6 @@ class Packet(db.Model):
5050
freshman_username = Column(ForeignKey("freshman.rit_username"))
5151
start = Column(DateTime, nullable=False)
5252
end = Column(DateTime, nullable=False)
53-
info_eboard = Column(Text, nullable=True) # Used to fulfil the eboard description requirement
54-
info_events = Column(Text, nullable=True) # Used to fulfil the events list requirement
55-
info_achieve = Column(Text, nullable=True) # Used to fulfil the technical achievements list requirement
5653

5754
freshman = relationship("Freshman", back_populates="packets")
5855
upper_signatures = relationship("UpperSignature", lazy="subquery",

packet/routes/freshmen.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -19,33 +19,3 @@ def index(info=None):
1919
return redirect(url_for("freshman_packet", packet_id=most_recent_packet.id), 302)
2020
else:
2121
return redirect(url_for("packets"), 302)
22-
23-
24-
@app.route("/essays/<packet_id>/")
25-
@packet_auth
26-
@before_request
27-
def essays(packet_id, info=None):
28-
packet = Packet.by_id(packet_id)
29-
30-
if packet is not None and packet.freshman_username == info["uid"]:
31-
return render_template("essays.html", info=info, packet=packet)
32-
else:
33-
return redirect(url_for("index"), 302)
34-
35-
36-
@app.route("/essays/<packet_id>/", methods=["POST"])
37-
@packet_auth
38-
@before_request
39-
def submit_essays(packet_id, info=None):
40-
packet = Packet.by_id(packet_id)
41-
42-
if packet is not None and packet.is_open() and packet.freshman_username == info["uid"]:
43-
packet.info_eboard = request.form.get("info_eboard", None)
44-
packet.info_events = request.form.get("info_events", None)
45-
packet.info_achieve = request.form.get("info_achieve", None)
46-
47-
db.session.commit()
48-
app.logger.info("Updated essays for {}".format(info["uid"]))
49-
return redirect(url_for("essays", packet_id=packet_id), 302)
50-
else:
51-
return redirect(url_for("index"), 302)

packet/templates/essays.html

Lines changed: 0 additions & 42 deletions
This file was deleted.

packet/templates/include/nav.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@
1818
<li class="nav-item">
1919
<a class="nav-link" href="{{ url_for("upperclassmen_total") }}">Signatures</a>
2020
</li>
21-
{% elif packet is defined and packet.freshman_username == info.uid %}
22-
<li class="nav-item">
23-
<a class="nav-link" href="{{ url_for("essays", packet_id=packet.id) }}">Essays</a>
24-
</li>
2521
{% endif %}
2622

2723
</ul>

0 commit comments

Comments
 (0)