Skip to content

Conversation

@ThiefMaster
Copy link
Member

This is a more correct fix for the bug mentioned in #6485

closes #6485

This fixes an error when a manager tried to register a user in a
private registration form
@ThiefMaster ThiefMaster added this to the v3.3 milestone Aug 13, 2024
@ThiefMaster ThiefMaster merged commit 4957e77 into indico:master Aug 13, 2024
@ThiefMaster ThiefMaster deleted the fix-reg-email-check branch August 13, 2024 09:48
@vtran99
Copy link
Contributor

vtran99 commented Aug 13, 2024

I tested this PR and still have the issue:
the check_access of RHRegistrationFormCheckEmail still calls RHRegistrationFormBase._check_access(self),
which still raise error because the form is private.

Did I miss sth ?

@ThiefMaster
Copy link
Member Author

Did you rebuild the assets? RHRegistrationFormCheckEmail is no longer used in the management area, it uses the new RHRegistrationCheckEmail one instead (which is a management-only endpoint).

@vtran99
Copy link
Contributor

vtran99 commented Aug 13, 2024

Ok for the email checker, but same error for RHUploadRegistrationFile:
the check access of this class refers to RHRegistrationFormBase._check_access(self) which requires token for private form.

Need to change check access of RHUploadRegistrationFile.

@ThiefMaster
Copy link
Member Author

We should handle those in the same way as for the email checker, ie with a separate RH.

@vtran99
Copy link
Contributor

vtran99 commented Aug 13, 2024

Doing that will require to duplicate RH (front-end, back-end) for each action on registration form,
why not implementing the logic in check_access following the context of the request ?

@ThiefMaster
Copy link
Member Author

The logic can (and should) be moved to mixins to avoid duplicating it.

"Simply" putting the logic in _check_access is a bit of a mess because all the access checks usually already come from the RH's inheritance. So it's a single place and somewhat consistent logic, compared to suddenly having a second place that determines whether you're in management mode.

And more important (this is more applicable to the email check than the upload endpoints): Being a manager does not mean that you are working in management mode. If I, as a manager, register normally for an event, then the email check should behave like it does when a user registers, and not like it would for a manager registering someone else.

AjobK pushed a commit to AjobK/indico that referenced this pull request Aug 14, 2024
This fixes an error when a manager tried to register a user in a
private registration form.
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.

2 participants