diff --git a/docker-compose.yml b/docker-compose.yml index 4b06ce6..dc452c4 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/commands.py b/packet/commands.py index 31f9590..179e973 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') @@ -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 5e14eef..d991dfe 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: date = datetime.strptime(request.json['start_date'], '%m/%d/%Y').date() + 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']) diff --git a/packet/templates/include/admin/new_packets.html b/packet/templates/include/admin/new_packets.html index c6dd307..c312f65 100644 --- a/packet/templates/include/admin/new_packets.html +++ b/packet/templates/include/admin/new_packets.html @@ -10,7 +10,7 @@