@@ -27,9 +27,7 @@ def participant(info: Info, id: strawberry.ID, conference: str) -> Participant |
2727
2828
2929@strawberry .field
30- def ticket_id_to_user_hashid (
31- ticket_id : strawberry .ID , conference_code : str
32- ) -> str | None :
30+ def ticket_id_to_hashid (ticket_id : strawberry .ID , conference_code : str ) -> str | None :
3331 conference = Conference .objects .filter (code = conference_code ).first ()
3432 decoded_ticket_id = decode_hashid (ticket_id )
3533 order_position = pretix .get_order_position (conference , decoded_ticket_id )
@@ -43,8 +41,10 @@ def ticket_id_to_user_hashid(
4341 if not attendee_user :
4442 return None
4543
46- user_id = attendee_user .id
47- return encode_hashid (int (user_id ), salt = settings .USER_ID_HASH_SALT , min_length = 6 )
44+ participant = ParticipantModel .objects .filter (
45+ conference = conference , user = attendee_user
46+ ).first ()
47+ return participant .hashid
4848
4949
5050# TODO: move this to a badge app :)
@@ -81,5 +81,5 @@ def conference_role_for_ticket_data(
8181
8282ParticipantQueries = create_type (
8383 "ParticipantQueries" ,
84- (participant , ticket_id_to_user_hashid , conference_role_for_ticket_data ),
84+ (participant , ticket_id_to_hashid , conference_role_for_ticket_data ),
8585)
0 commit comments