Skip to content

Adds a check for assigned target not being null when creating an asset #16675

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

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

Godmartinz
Copy link
Member

@Godmartinz Godmartinz commented Apr 9, 2025

This adds a $target check when assigning during creating an asset. It will now redirect back
Returns a message of The assigned user could not be found.
image
also a similar error message for assigned asset and locations

@Godmartinz Godmartinz requested a review from snipe as a code owner April 9, 2025 18:04
Copy link

what-the-diff bot commented Apr 9, 2025

PR Summary

  • Refined Location Determination Logic in 'store' Method
    In the 'store' method of 'AssetsController', we enhanced its logic to detect the 'location'. Now, if the 'location_id' is not set for both 'User' and 'Asset' targets, the system will intelligently revert to use 'rtd_location_id' instead. This will help ensure the location is always identified accurately.

@snipe
Copy link
Member

snipe commented Apr 9, 2025

Are we sure that's the behavior we want? Also, I don't think that directly addresses the rollbar, which was triggered on the line before. It's the target that was null,

Screenshot 2025-04-09 at 7 06 35 PM

@Godmartinz
Copy link
Member Author

whoops i misread the rollbar.. working on it!

@snipe
Copy link
Member

snipe commented Apr 9, 2025

Alright quickdraw :D

hq720

Man, really dating myself here.

@snipe
Copy link
Member

snipe commented Apr 9, 2025

I feel like the bigger question here is why would that target be null?

@Godmartinz Godmartinz changed the title Adds a fallback for location_id when validating before saving a new asset Adds a check for assigned target not being null when creating an asset Apr 9, 2025
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