Skip to content
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

3686 reroute user to error page fix #3974

Merged

Conversation

thebkbuffalo
Copy link
Contributor

Resolves #3686

Description

Gracefully handles error when a partner clicks the Review This Partner link from email. User is taken to partners root path (dashboard) with an error message stating they must be logged in as an org admin to approve a partner application.

Please also include relevant motivation and context.
Guide questions:

  • What motivated this change (if not already described in an issue)?
    • fixing a bug
  • What alternative solutions did you consider?
    • I considered providing the missing data for the necessary links that were breaking.
  • What are the tradeoffs for your solution?
    • that solution exposed pages that shouldn't be

List any dependencies that are required for this change. (gems, js libraries, etc.)

Include anything else we should know about. -->

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Yes.

Screenshots

…s a partner they will be redirected to the partner users dashboard with an error message telling them they must be logged in as an org user to approve a new partner.
…d fixed tests accordingly. Added tests for redirect and warning if a partner clicks the review partner link from email
Copy link
Collaborator

@dorner dorner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking better - still need to make one change!

@@ -164,6 +165,13 @@ def reactivate

private

def validate_user_role
if current_user.kind == 'partner'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work, because a user can have roles both as a partner and an org admin. You need to check current_role to determine what the user is currently logged in as, and base it off of that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhh got ya. Change has been made along with 2 changes from the ruby linter. Should be good to go now.

…ole and 2 small changes based on ruby linter
@dorner
Copy link
Collaborator

dorner commented Dec 20, 2023

Looks good - thanks!

@dorner dorner merged commit 7865ba3 into rubyforgood:main Dec 20, 2023
12 checks passed
Copy link
Contributor

@thebkbuffalo: Your PR 3686 reroute user to error page fix is part of today's Human Essentials production release: 2023.12.24.
Thank you very much for your contribution!

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.

[Bug] Fix nasty error when clicking on partner approval request email as partner
2 participants