diff --git a/README.md b/README.md index 0086c7b32..e0f4154f6 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,11 @@ Since the release of the JSON REST API, several third-party developers have been ### Contributing -Please see the documentation on [contributing and developing for Snipe-IT](https://snipe-it.readme.io/docs/contributing-overview). +Please refrain from submitting issues or pull requests generated by fully-automated tools. Maintainers reserve the right, at their sole discretion, to close such submissions and to block any account responsible for them. + +Ideally, contributions should follow from a human-to-human discussion in the form of an issue. + +Please see the complete documentation on [contributing and developing for Snipe-IT](https://snipe-it.readme.io/docs/contributing-overview). Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms. diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index 00c5416af..d4a103be3 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -598,7 +598,6 @@ class AssetsController extends Controller $asset->model()->associate(AssetModel::find((int) $request->get('model_id'))); $asset->fill($request->validated()); - $asset->company_id = Company::getIdForCurrentUser($request->validated()['company_id']); $asset->created_by = auth()->id(); /** diff --git a/app/Http/Requests/StoreAssetRequest.php b/app/Http/Requests/StoreAssetRequest.php index e1665e213..26d01051b 100644 --- a/app/Http/Requests/StoreAssetRequest.php +++ b/app/Http/Requests/StoreAssetRequest.php @@ -26,18 +26,11 @@ class StoreAssetRequest extends ImageUploadRequest public function prepareForValidation(): void { - // Guard against users passing in an array for company_id instead of an integer. - // If the company_id is not an integer then we simply use what was - // provided to be caught by model level validation later. - $idForCurrentUser = is_int($this->company_id) - ? Company::getIdForCurrentUser($this->company_id) - : $this->company_id; - $this->parseLastAuditDate(); $this->merge([ 'asset_tag' => $this->asset_tag ?? Asset::autoincrement_asset(), - 'company_id' => $idForCurrentUser, + 'company_id' => Company::getIdForCurrentUser($this->company_id), 'assigned_to' => $assigned_to ?? null, ]); } diff --git a/app/Models/Location.php b/app/Models/Location.php index e6c310979..014db3053 100755 --- a/app/Models/Location.php +++ b/app/Models/Location.php @@ -42,7 +42,7 @@ class Location extends SnipeModel ]; /** - * Whether the model should inject it's identifier to the unique + * Whether the model should inject its identifier to the unique * validation rules before attempting validation. If this property * is not set in the model it will default to true. * diff --git a/resources/views/locations/edit.blade.php b/resources/views/locations/edit.blade.php index 55d638a9f..4b4e655a5 100755 --- a/resources/views/locations/edit.blade.php +++ b/resources/views/locations/edit.blade.php @@ -25,9 +25,15 @@ -