Skip to content

Conversation

@vtran99
Copy link
Contributor

@vtran99 vtran99 commented Mar 11, 2024

Request to add the display of picture in Participant List, which is currently missing.

@tomasr8
Copy link
Member

tomasr8 commented Mar 15, 2024

I'm getting this error when viewing the participant list:

  File "/home/troun/dev/indico/indico/modules/events/registration/controllers/display.py", line 230, in _process
    tables = [self._merged_participant_list_table()]
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/troun/dev/indico/indico/modules/events/registration/controllers/display.py", line 162, in _merged_participant_list_table
    registrations = sorted(_deduplicate_reg_data(_process_registration(reg, column_names)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/troun/dev/indico/indico/modules/events/registration/controllers/display.py", line 144, in _deduplicate_reg_data
    for reg_data in reg_data_iter:
  File "/home/troun/dev/indico/indico/modules/events/registration/controllers/display.py", line 162, in <genexpr>
    registrations = sorted(_deduplicate_reg_data(_process_registration(reg, column_names)
                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/troun/dev/indico/indico/modules/events/registration/controllers/display.py", line 139, in _process_registration
    columns.append({'text': self._picture_url(reg), 'is_picture': True})
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/troun/dev/indico/indico/modules/events/registration/controllers/display.py", line 129, in _picture_url
    if reg.picture_data:
       ^^^^^^^^^^^^^^^^^
AttributeError: 'Registration' object has no attribute 'picture_data'

There's no picture_data on Registration, did you mean to use get_personal_data_picture?

@ThiefMaster ThiefMaster force-pushed the Add_picture_to_participant_list branch from 096c540 to 88c374e Compare March 18, 2024 13:06
@ThiefMaster
Copy link
Member

I rebased it and fixed the bugs with which testing this PR was impossible.

@ThiefMaster
Copy link
Member

Please add a changelog entry:

- Add the option to include the picture of a registration in the conference participant list
  (:pr:`6228`, thanks :user:`vtran99`)

@vtran99 vtran99 force-pushed the Add_picture_to_participant_list branch from 3da74de to ff1f557 Compare March 25, 2024 19:45
@vtran99
Copy link
Contributor Author

vtran99 commented Mar 25, 2024

I updated the code following your comments( fix display position, manage case other pictures, optimise query, add change log) and merged in new commit.
Please review again.

@vtran99 vtran99 requested a review from ThiefMaster March 25, 2024 19:50
@ThiefMaster ThiefMaster force-pushed the Add_picture_to_participant_list branch 3 times, most recently from 99f7f59 to 138908d Compare May 6, 2024 15:16
- Move changelog to correct version
- Do not generate image URL when there is no image
- Do not render img with empty src
- Make Forbidden errors more verbose
- Fail nicely when there is no picture
- Exclude image columns from sorting
@ThiefMaster ThiefMaster force-pushed the Add_picture_to_participant_list branch from 138908d to 48f11b1 Compare May 6, 2024 15:19
@ThiefMaster ThiefMaster enabled auto-merge (squash) May 6, 2024 15:20
@ThiefMaster ThiefMaster added this to the v3.3 milestone May 6, 2024
@ThiefMaster ThiefMaster merged commit 9713c98 into indico:master May 6, 2024
@ThiefMaster ThiefMaster deleted the Add_picture_to_participant_list branch May 6, 2024 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants