@@ -91,7 +91,7 @@ async def validate(self, computing_id: str, old_officer_info: OfficerInfo) -> tu
9191 corrected_officer_info .discord_id = discord_user .id
9292 corrected_officer_info .discord_nickname = discord_user .global_name
9393
94- # TODO: validate google-email using google module, by trying to assign the user to a permission or something
94+ # TODO (#82) : validate google-email using google module, by trying to assign the user to a permission or something
9595 if not utils .is_valid_email (self .google_drive_email ):
9696 validation_failures += [f"invalid email format { self .google_drive_email } " ]
9797 corrected_officer_info .google_drive_email = old_officer_info .google_drive_email
@@ -101,15 +101,16 @@ async def validate(self, computing_id: str, old_officer_info: OfficerInfo) -> tu
101101 validation_failures += [f"invalid github username { self .github_username } " ]
102102 corrected_officer_info .github_username = old_officer_info .github_username
103103
104- # TODO: if github user exists, invite the github user to the org (or can we simply add them directly?)
105- # -> do so outside this function
106- # TODO: detect if changing github username & uninvite old user
104+ # TODO (#93): add the following to the daily cronjob
105+ # TODO (#97): if github user exists, invite the github user to the org (or can we simply add them directly?)
106+ # -> do so outside this function. Also, detect if the github username is being changed & uninvite the old user
107107
108108 return validation_failures , corrected_officer_info
109109
110110@dataclass
111111class OfficerTermUpload :
112112 # only admins can change:
113+ computing_id : str
113114 position : str
114115 start_date : date
115116 end_date : None | date = None
@@ -122,22 +123,20 @@ class OfficerTermUpload:
122123 favourite_pl_1 : None | str = None
123124 biography : None | str = None
124125
125- # TODO: we're going to need an API call to upload images
126- # NOTE: changing the name of this variable without changing all instances is breaking
126+ # TODO (#39): we're going to need an endpoint for uploading images
127127 photo_url : None | str = None
128128
129129 def valid_or_raise (self ):
130- # NOTE: An officer can change their own data for terms that are ongoing.
131130 if self .position not in OfficerPosition .position_list ():
132131 raise HTTPException (status_code = 400 , detail = f"invalid new position={ self .position } " )
133132 elif self .end_date is not None and self .start_date > self .end_date :
134133 raise HTTPException (status_code = 400 , detail = "end_date must be after start_date" )
135134
136- def to_officer_term (self , term_id : str , computing_id : str ) -> OfficerTerm :
135+ def to_officer_term (self , term_id : str ) -> OfficerTerm :
137136 return OfficerTerm (
138137 id = term_id ,
139- computing_id = computing_id ,
140138
139+ computing_id = self .computing_id ,
141140 position = self .position ,
142141 start_date = self .start_date ,
143142 end_date = self .end_date ,
0 commit comments