-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid exceptions in Management section #4443
Conversation
513311a
to
abf7954
Compare
abf7954
to
06470a2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@taitus Great we're finally dealing with this part of the code 😄.
How about adding a test for another scenario? Users go to "Print proposals" and click the "Support" button in one of the proposals.
0330f8c
to
e7cdd40
Compare
e7cdd40
to
85c0797
Compare
We prepare the file to be able to include specs that do not need to have a logged-in user. We also took the opportunity to not execute this line in some specs where it was not necessary.
85c0797
to
0e05255
Compare
Many management actions only make sense if a user has been selected beforehand. We updated :check_verified_user method to be able to check actions that need to have a user selected in order to avoid exceptions. We need this control as :only_verified_user is not restrictive enough. The reason is that the :managed_user method used in the :only_verified_user if it does not find a user it does an initializce (find_or_initialize_by). This causes that when we have "skip_verification" to true, it returns this non-persisted user as "verified". These changes affect the actions of Account, Budgets and Proposals Controller when no user is selected.
0e05255
to
e213814
Compare
The test which failed is not related to this pull request and will be fixed by #4467. |
References
Closes #2767
Objectives
Many management actions only make sense if a user has been selected beforehand.
The objective is only allow management actions when we have a selected user.
Notes
I was unable to reproduce the error in the related issue (#2767) with the steps above.
But I have detected a bug related and even partially commented on in some comments of that issue.