Skip to content

Commit ce28f15

Browse files
committed
wip: removed some unused imports and updated some constraints
1 parent 777948c commit ce28f15

File tree

5 files changed

+5
-6
lines changed

5 files changed

+5
-6
lines changed

src/elections/tables.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from sqlalchemy import (
44
Date,
5-
DateTime,
65
String,
76
)
87
from sqlalchemy.orm import Mapped, mapped_column

src/officers/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from enum import StrEnum
22

3+
OFFICER_POSITION_MAX_LENGTH = 128
34

45
class OfficerPositionEnum(StrEnum):
56
PRESIDENT = "president"

src/officers/models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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

src/officers/tables.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
from sqlalchemy import (
66
Date,
7-
DateTime,
87
ForeignKey,
98
Integer,
109
String,
@@ -21,7 +20,7 @@
2120
GITHUB_USERNAME_LEN,
2221
)
2322
from 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)

src/officers/urls.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import database
66
import officers.crud
77
import utils
8-
from elections.urls import get_election_permissions
98
from officers.models import PrivateOfficerResponse, PublicOfficerResponse
109
from officers.tables import OfficerInfo, OfficerTerm
1110
from officers.types import InitialOfficerInfo, OfficerInfoUpload, OfficerTermUpload

0 commit comments

Comments
 (0)