3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-03-29 20:04:21 +00:00

Don’t let the user checkout an asset to itself

(We should consolidate that AssetCheckoutRequest for the API)
This commit is contained in:
snipe
2017-10-19 15:51:55 -07:00
parent 2fc46746e2
commit 1f247ff541
4 changed files with 21 additions and 6 deletions

View File

@ -458,7 +458,7 @@ class AssetsController extends Controller
if (request('assigned_user')) {
$target = User::find(request('assigned_user'));
} elseif (request('assigned_asset')) {
$target = Asset::find(request('assigned_asset'));
$target = Asset::where('id','!=',$assetId)->find(request('assigned_asset'));
} elseif (request('assigned_location')) {
$target = Location::find(request('assigned_location'));
}