mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-13 06:47:46 -08:00
Only error if checking out to asset with same id (#5845)
A user with an id of 2 is perfectly fine as a checkout_target of an asset with an id of 2.
This commit is contained in:
parent
50e0b9b84e
commit
8f6e0ad5be
|
@ -1220,7 +1220,7 @@ class AssetsController extends Controller
|
||||||
|
|
||||||
$asset_ids = array_filter(Input::get('selected_assets'));
|
$asset_ids = array_filter(Input::get('selected_assets'));
|
||||||
foreach ($asset_ids as $asset_id) {
|
foreach ($asset_ids as $asset_id) {
|
||||||
if ($target->id == $asset_id) {
|
if ($target->id == $asset_id && request('checkout_to_type')=='asset') {
|
||||||
return redirect()->back()->with('error', 'You cannot check an asset out to itself.');
|
return redirect()->back()->with('error', 'You cannot check an asset out to itself.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue