Skip to content

Commit

Permalink
improve all frosh signing capabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam-Cordry committed Jan 26, 2025
1 parent 46676ab commit 8418b60
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions packet/templates/active_packets.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,17 @@ <h4 class="page-title">Active Packets</h4>
{% for packet in packets %}
<tr {% if packet.did_sign_result %}style="background-color: #4caf505e" {% endif %}>
<td data-priority="1">
{% if info.is_upper %}
<a href="{{ url_for('freshman_packet', packet_id=packet.id) }}">
{% endif %}
<img class="eval-user-img"
alt="{{ get_rit_name(packet.freshman_username) }}"
src="{{ get_rit_image(packet.freshman_username) }}"
width="25"
height="25"/> {{ get_rit_name(packet.freshman_username) }}
{% if info.is_upper %}
</a>
{% endif %}
</td>
{% if info.is_upper %}
<td data-sort="{{ packet.signatures_received_result.member_total }}">
Expand Down
4 changes: 2 additions & 2 deletions packet/templates/packet.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<h3>{{ get_rit_name(packet.freshman_username) }}</h3>
</div>
<div class="col">
{% if not did_sign %}
{% if not did_sign and info.ritdn != packet.freshman_username %}
<button class="btn btn-primary sign-button"
data-packet_id="{{ packet.id }}"
data-freshman_name="{{ get_rit_name(packet.freshman_username) }}">Sign
Expand Down Expand Up @@ -108,7 +108,7 @@ <h5>Upperclassmen Score - {{ '%0.2f' % upper_score }}%</h5>
{% if info.is_upper or packet.freshman_username == info.ritdn %}
<div class="card mb-2">
<div class="card-header">
<b>On-Floor Freshmen Signatures</b>
<b>Freshmen Signatures</b>
{% if info.is_upper or packet.freshman_username == info.ritdn %}
<b class="signature-count">{{ received.fresh }}/{{ required.fresh }}</b>
{% else %}
Expand Down
8 changes: 4 additions & 4 deletions packet/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def create_new_packets(base_date: date, freshmen_list: dict) -> None:
start = datetime.combine(base_date, packet_start_time)
end = datetime.combine(base_date, packet_end_time) + timedelta(days=14)

print('Fetching data from LDAP...')
app.logger.info('Fetching data from LDAP...')
all_upper = list(filter(
lambda member: not ldap.is_intromember(member) and not ldap.is_on_coop(member), ldap.get_active_members()))

Expand All @@ -182,7 +182,7 @@ def create_new_packets(base_date: date, freshmen_list: dict) -> None:
packets_starting_notification(start)

# Create the new packets and the signatures for each freshman in the given CSV
print('Creating DB entries and sending emails...')
app.logger.info('Creating DB entries and sending emails...')
for freshman in Freshman.query.filter(cast(Any, Freshman.rit_username).in_(freshmen_list)).all():
packet = Packet(freshman=freshman, start=start, end=end)
db.session.add(packet)
Expand All @@ -207,7 +207,7 @@ def create_new_packets(base_date: date, freshmen_list: dict) -> None:


def sync_with_ldap() -> None:
print('Fetching data from LDAP...')
app.logger.info('Fetching data from LDAP...')
all_upper = {member.uid: member for member in filter(
lambda member: not ldap.is_intromember(member) and not ldap.is_on_coop(member), ldap.get_active_members())}

Expand All @@ -218,7 +218,7 @@ def sync_with_ldap() -> None:
w_m = ldap.get_wiki_maintainers()
drink = ldap.get_drink_admins()

print('Applying updates to the DB...')
app.logger.info('Applying updates to the DB...')
for packet in Packet.query.filter(Packet.end > datetime.now()).all():
# Update the role state of all UpperSignatures
for sig in filter(lambda sig: sig.member in all_upper, packet.upper_signatures):
Expand Down

0 comments on commit 8418b60

Please sign in to comment.