Skip to content

Commit

Permalink
Breaks in reports fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
arjuntalati committed Jul 28, 2024
1 parent 84e9c9d commit ead593a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

SCHWARTZ_EMAIL = "ems@ufl.edu"


def semester_given_date(
date: datetime.datetime,
*,
Expand All @@ -29,6 +30,7 @@ def semester_given_date(
return semester
return None


class Team(enum.Enum):
SOFTWARE = auto()
ELECTRICAL = auto()
Expand Down
9 changes: 3 additions & 6 deletions src/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@

import discord
import gspread
import gspread_asyncio
from discord.ext import commands

from .constants import SCHWARTZ_EMAIL, Team, semester_given_date
from .constants import BREAKS, SCHWARTZ_EMAIL, Team, semester_given_date
from .email import Email
from .tasks import run_on_weekday
from .utils import is_active, ordinal
Expand Down Expand Up @@ -64,10 +63,7 @@ def _end_date(cls) -> datetime.date:

@staticmethod
def _is_break(date: datetime.date) -> bool:
for start, end in BREAKS:
if start <= date <= end:
return True
return False
return any(start <= date <= end for start, end in BREAKS)

def _date_to_index(self, date: datetime.date) -> int:
current_date = self._start_date()
Expand Down Expand Up @@ -144,6 +140,7 @@ def __post_init__(self):
f"Cannot create report column with index {self.report_column}.",
)


class FiringEmail(Email):
"""
Email to Dr. Schwartz + team lead about needing to fire someone
Expand Down

0 comments on commit ead593a

Please sign in to comment.