@@ -61,7 +61,7 @@ class ConfirmationTokenInfoDict(ConfirmationTokenDict):
6161 url : str
6262
6363
64- class InvitationData (BaseModel ):
64+ class ConfirmedInvitationData (BaseModel ):
6565 issuer : str | None = Field (
6666 None ,
6767 description = "Who has issued this invitation? (e.g. an email or a uid)" ,
@@ -80,7 +80,7 @@ class InvitationData(BaseModel):
8080
8181class _InvitationValidator (BaseModel ):
8282 action : ConfirmationAction
83- data : Json [InvitationData ] # pylint: disable=unsubscriptable-object
83+ data : Json [ConfirmedInvitationData ] # pylint: disable=unsubscriptable-object
8484
8585 @field_validator ("action" , mode = "before" )
8686 @classmethod
@@ -91,7 +91,7 @@ def ensure_enum(cls, v):
9191
9292
9393ACTION_TO_DATA_TYPE : dict [ConfirmationAction , type | None ] = {
94- ConfirmationAction .INVITATION : InvitationData ,
94+ ConfirmationAction .INVITATION : ConfirmedInvitationData ,
9595 ConfirmationAction .REGISTRATION : None ,
9696}
9797
@@ -188,7 +188,7 @@ async def create_invitation_token(
188188 :type host: Dict-like
189189 :param guest: some description of the guest, e.g. email, name or a json
190190 """
191- data_model = InvitationData (
191+ data_model = ConfirmedInvitationData (
192192 issuer = user_email ,
193193 guest = tag ,
194194 trial_account_days = trial_days ,
@@ -269,7 +269,7 @@ async def check_and_consume_invitation(
269269 db : AsyncpgStorage ,
270270 cfg : LoginOptions ,
271271 app : web .Application ,
272- ) -> InvitationData :
272+ ) -> ConfirmedInvitationData :
273273 """Consumes invitation: the code is validated, the invitation retrieives and then deleted
274274 since it only has one use
275275
@@ -292,7 +292,7 @@ async def check_and_consume_invitation(
292292 "Consuming invitation from service:\n %s" ,
293293 content .model_dump_json (indent = 1 ),
294294 )
295- return InvitationData (
295+ return ConfirmedInvitationData (
296296 issuer = content .issuer ,
297297 guest = content .guest ,
298298 trial_account_days = content .trial_account_days ,
@@ -305,9 +305,9 @@ async def check_and_consume_invitation(
305305 invitation_code , db , cfg
306306 ):
307307 try :
308- invitation_data : InvitationData = _InvitationValidator . model_validate (
309- confirmation_token
310- ). data
308+ invitation_data : ConfirmedInvitationData = (
309+ _InvitationValidator . model_validate ( confirmation_token ). data
310+ )
311311 return invitation_data
312312
313313 except ValidationError as err :
0 commit comments