Skip to content

Conversation

@amCap1712
Copy link
Contributor

The task to purge registration field data beyond retention period overwrites the field data with the field's default value.

# Overwrite with the field's default value.
# This is cleaner than setting the data to 'None' since some fields
# expect structured data e.g. Accommodation & {Single,Multi}Choice.
# This makes the React code relatively simple and we can always distinguish
# purged fields since they have the 'is_purged' flag set to True
.
Check if field is purged before trying to render its value in registration details to avoid displaying such data to the user.

Before:
image

After:
image

Fixes #5898

amCap1712 and others added 2 commits February 24, 2025 18:15
The task to purge registration field data beyond retention period overwrites
the field data with the field's default value. See https://github.com/indico/indico/blob/e9e4daab682c1d93cde575d3446fed265427da72/indico/modules/events/registration/tasks.py#L63-L67 for rationale.
Check if field is purged before trying to render its value in registration details.
@ThiefMaster ThiefMaster added this to the v3.3 milestone Feb 24, 2025
@ThiefMaster ThiefMaster enabled auto-merge (squash) February 24, 2025 17:17
@ThiefMaster ThiefMaster merged commit 5b137a8 into indico:master Feb 24, 2025
10 checks passed
@ThiefMaster
Copy link
Member

I just noticed that we should do the same in the table listing all the registrations. For example, for an accommodation field that has been purged, it currently looks like this:

image

which is the "falsy" default value for this field type.

amCap1712 added a commit to amCap1712/indico that referenced this pull request Feb 28, 2025
Implemented the same changes as indico#6772 but for registrations list table on manage
registrations page.
amCap1712 added a commit to amCap1712/indico that referenced this pull request Feb 28, 2025
Implemented the same changes as indico#6772 but for registrations list table on manage
registrations page.
ThiefMaster pushed a commit to amCap1712/indico that referenced this pull request Mar 19, 2025
Implemented the same changes as indico#6772 but for registrations list table on manage
registrations page.
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.

Some purged regform fields show falsy value instead of nothing

2 participants