File tree Expand file tree Collapse file tree 5 files changed +5
-6
lines changed Expand file tree Collapse file tree 5 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 22
33from sqlalchemy import (
44 Date ,
5- DateTime ,
65 String ,
76)
87from sqlalchemy .orm import Mapped , mapped_column
Original file line number Diff line number Diff line change 11from enum import StrEnum
22
3+ OFFICER_POSITION_MAX_LENGTH = 128
34
45class OfficerPositionEnum (StrEnum ):
56 PRESIDENT = "president"
Original file line number Diff line number Diff line change @@ -18,8 +18,9 @@ class PublicOfficerResponse(BaseOfficerModel):
1818 """
1919 is_active : bool
2020 nickname : str | None = None
21+ discord_id : str | None = None
2122 discord_name : str | None = None
22- discord_nickname : int | None = None
23+ discord_nickname : str | None = None
2324 biography : str | None = None
2425 csss_email : str
2526
Original file line number Diff line number Diff line change 44
55from sqlalchemy import (
66 Date ,
7- DateTime ,
87 ForeignKey ,
98 Integer ,
109 String ,
2120 GITHUB_USERNAME_LEN ,
2221)
2322from database import Base
24- from officers .constants import OfficerPositionEnum
23+ from officers .constants import OFFICER_POSITION_MAX_LENGTH , OfficerPositionEnum
2524
2625
2726# A row represents an assignment of a person to a position.
@@ -37,7 +36,7 @@ class OfficerTerm(Base):
3736 nullable = False ,
3837 )
3938
40- position : Mapped [OfficerPositionEnum ] = mapped_column (String (128 ), nullable = False )
39+ position : Mapped [OfficerPositionEnum ] = mapped_column (String (OFFICER_POSITION_MAX_LENGTH ), nullable = False )
4140 start_date : Mapped [datetime ] = mapped_column (Date , nullable = False )
4241 # end_date is only not-specified for positions that don't have a length (ie. webmaster)
4342 end_date : Mapped [datetime ] = mapped_column (Date , nullable = True )
Original file line number Diff line number Diff line change 55import database
66import officers .crud
77import utils
8- from elections .urls import get_election_permissions
98from officers .models import PrivateOfficerResponse , PublicOfficerResponse
109from officers .tables import OfficerInfo , OfficerTerm
1110from officers .types import InitialOfficerInfo , OfficerInfoUpload , OfficerTermUpload
You can’t perform that action at this time.
0 commit comments