From 4ab59f077fcb0a14ed8e85b0403a7e7ca7dffb10 Mon Sep 17 00:00:00 2001
From: Mobmaker <45888585+Mobmaker55@users.noreply.github.com>
Date: Sun, 24 Aug 2025 13:23:11 -0400
Subject: [PATCH 1/4] Time is schedulable
---
docker-compose.yml | 2 +-
packet/routes/api.py | 2 +-
packet/templates/include/admin/new_packets.html | 2 +-
packet/utils.py | 8 +++-----
4 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/docker-compose.yml b/docker-compose.yml
index 4b06ce62..dc452c4d 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -24,7 +24,7 @@ services:
condition: service_healthy
restart: true
postgres:
- image: "postgres:17"
+ image: "docker.io/postgres:17"
networks:
- packet-network-dev
environment:
diff --git a/packet/routes/api.py b/packet/routes/api.py
index 5e14eefe..2f0f0905 100644
--- a/packet/routes/api.py
+++ b/packet/routes/api.py
@@ -76,7 +76,7 @@ def create_packet() -> Tuple[str, int]:
if not ldap.is_evals(ldap.get_member(username)):
return 'Forbidden: not Evaluations Director', 403
- base_date: date = datetime.strptime(request.json['start_date'], '%m/%d/%Y').date()
+ base_date: date = datetime.strptime(request.json['start_date'], '%m/%d/%Y %H')
freshmen_in_post: Dict[str, POSTFreshman] = {
freshman.rit_username: freshman for freshman in map(POSTFreshman, request.json['freshmen'])
diff --git a/packet/templates/include/admin/new_packets.html b/packet/templates/include/admin/new_packets.html
index c6dd3075..c312f650 100644
--- a/packet/templates/include/admin/new_packets.html
+++ b/packet/templates/include/admin/new_packets.html
@@ -10,7 +10,7 @@
New Packets
diff --git a/packet/utils.py b/packet/utils.py
index 26f5fe6d..f90e2859 100644
--- a/packet/utils.py
+++ b/packet/utils.py
@@ -161,11 +161,9 @@ def sync_freshman(freshmen_list: dict) -> None:
db.session.commit()
-def create_new_packets(base_date: date, freshmen_list: dict) -> None:
- packet_start_time = time(hour=19)
- packet_end_time = time(hour=21)
- start = datetime.combine(base_date, packet_start_time)
- end = datetime.combine(base_date, packet_end_time) + timedelta(days=14)
+def create_new_packets(base_date: datetime, freshmen_list: dict) -> None:
+ start = base_date
+ end = base_date + timedelta(days=14)
app.logger.info('Fetching data from LDAP...')
all_upper = list(filter(
From aa03245dcaf019bfafc2136b164e594c4378e5f0 Mon Sep 17 00:00:00 2001
From: Mobmaker <45888585+Mobmaker55@users.noreply.github.com>
Date: Sun, 24 Aug 2025 13:26:11 -0400
Subject: [PATCH 2/4] fix types and imports
---
packet/routes/api.py | 2 +-
packet/utils.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/packet/routes/api.py b/packet/routes/api.py
index 2f0f0905..aaa568b5 100644
--- a/packet/routes/api.py
+++ b/packet/routes/api.py
@@ -76,7 +76,7 @@ def create_packet() -> Tuple[str, int]:
if not ldap.is_evals(ldap.get_member(username)):
return 'Forbidden: not Evaluations Director', 403
- base_date: date = datetime.strptime(request.json['start_date'], '%m/%d/%Y %H')
+ base_date = datetime.strptime(request.json['start_date'], '%m/%d/%Y %H')
freshmen_in_post: Dict[str, POSTFreshman] = {
freshman.rit_username: freshman for freshman in map(POSTFreshman, request.json['freshmen'])
diff --git a/packet/utils.py b/packet/utils.py
index f90e2859..496bf5c8 100644
--- a/packet/utils.py
+++ b/packet/utils.py
@@ -1,7 +1,7 @@
"""
General utilities and decorators for supporting the Python logic
"""
-from datetime import datetime, time, timedelta, date
+from datetime import datetime, timedelta
from functools import wraps, lru_cache
from typing import Any, Callable, TypeVar, cast
from urllib.parse import urlparse
From 128ffdbf246ff2b37846358abfce178c09d5b4e5 Mon Sep 17 00:00:00 2001
From: Tyler Allen
Date: Sun, 24 Aug 2025 13:29:51 -0400
Subject: [PATCH 3/4] removed broken command
---
packet/commands.py | 32 ++++++++++++++++----------------
packet/routes/api.py | 4 ++--
2 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/packet/commands.py b/packet/commands.py
index 31f95909..a1e07547 100644
--- a/packet/commands.py
+++ b/packet/commands.py
@@ -65,22 +65,22 @@ def sync_freshmen(freshmen_csv: str) -> None:
sync_freshman(freshmen_in_csv)
print('Done!')
-
-@app.cli.command('create-packets')
-@click.argument('freshmen_csv')
-def create_packets(freshmen_csv: str) -> None:
- """
- Creates a new packet season for each of the freshmen in the given CSV.
- """
- print("WARNING: The 'sync-freshmen' command must be run first to ensure that the state of floor is up to date.")
- if input('Continue? (y/N): ').lower() != 'y':
- return
-
- # Collect the necessary data
- base_date = input_date('Input the first day of packet season')
- freshmen_in_csv = parse_csv(freshmen_csv)
- create_new_packets(base_date, freshmen_in_csv)
- print('Done!')
+# TODO: this needs fixed with a proper datetime
+# @app.cli.command('create-packets')
+# @click.argument('freshmen_csv')
+# def create_packets(freshmen_csv: str) -> None:
+# """
+# Creates a new packet season for each of the freshmen in the given CSV.
+# """
+# print("WARNING: The 'sync-freshmen' command must be run first to ensure that the state of floor is up to date.")
+# if input('Continue? (y/N): ').lower() != 'y':
+# return
+
+# # Collect the necessary data
+# base_date = input_date('Input the first day of packet season')
+# freshmen_in_csv = parse_csv(freshmen_csv)
+# create_new_packets(base_date, freshmen_in_csv)
+# print('Done!')
@app.cli.command('ldap-sync')
diff --git a/packet/routes/api.py b/packet/routes/api.py
index aaa568b5..d991dfeb 100644
--- a/packet/routes/api.py
+++ b/packet/routes/api.py
@@ -1,7 +1,7 @@
"""
Shared API endpoints
"""
-from datetime import datetime, date
+from datetime import datetime
from json import dumps
from typing import Dict, Any, Union, Tuple
@@ -76,7 +76,7 @@ def create_packet() -> Tuple[str, int]:
if not ldap.is_evals(ldap.get_member(username)):
return 'Forbidden: not Evaluations Director', 403
- base_date = datetime.strptime(request.json['start_date'], '%m/%d/%Y %H')
+ base_date: datetime = datetime.strptime(request.json['start_date'], '%m/%d/%Y %H')
freshmen_in_post: Dict[str, POSTFreshman] = {
freshman.rit_username: freshman for freshman in map(POSTFreshman, request.json['freshmen'])
From e2f7f0743798f1e95245bd8e3ac136fc36cade1d Mon Sep 17 00:00:00 2001
From: Tyler Allen
Date: Sun, 24 Aug 2025 15:54:21 -0400
Subject: [PATCH 4/4] lint
---
packet/commands.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packet/commands.py b/packet/commands.py
index a1e07547..179e9738 100644
--- a/packet/commands.py
+++ b/packet/commands.py
@@ -11,7 +11,7 @@
from . import app, db
from .models import Packet, FreshSignature, UpperSignature, MiscSignature
-from .utils import sync_freshman, create_new_packets, sync_with_ldap
+from .utils import sync_freshman, sync_with_ldap
@app.cli.command('create-secret')