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

Fixed check for outside assets on user update validation #15516

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

snipe
Copy link
Owner

@snipe snipe commented Sep 17, 2024

This clarifies the validation on user editing to only throw a failure if the user has asset that belong to a different company ID. (It was previously incorrectly throwing a validation error if the user had any assets assigned, regardless of the company the assets belong to.)

Copy link

what-the-diff bot commented Sep 17, 2024

PR Summary

  • Improved Validation Logic
    The rules regarding user switching between companies have been tightened. Now, we will check if a user has any assets tied to a different company before allowing a change of company. This ensures that users can't mistakenly leave a company with important items still associated with their previous company.

  • Better Erroneous Switch Message
    We've made our error messages more informative. When a user attempts to switch a company but he/she has items assigned from another company, our new error message clearly tells that. Now, it's easier to understand why a request might have failed.

  • Interactive Company Names
    The user's company name will now display as a clickable link (provided the user has the necessary permissions). This makes it quicker and easier for the user to navigate to their company page.

  • Clearer Test Names
    We've given our tests more descriptive names. The tests that check whether users can change companies if they have items assigned from another company now have names that reflect their purpose. This improvement will make our testing process more intuitive and transparent.

  • Additional Test Scenarios
    We have added new tests to confirm the proper functioning of user updates when assets are assigned to the same company. This ensures that the process of changing a user’s associated company remains smooth even when assets are involved. It also guarantees a comprehensive checks-and-balances system keeping the asset ownership and company switch in harmony.

Copy link
Collaborator

@uberbrady uberbrady left a comment

Choose a reason for hiding this comment

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

Very nice tests! I like that; a lot!

This reads pretty cleanly to me, great work!

@snipe snipe merged commit 6c996b7 into develop Sep 17, 2024
8 checks passed
@snipe snipe deleted the fixes/fmcs_edit_user branch September 17, 2024 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants